1 /* cclive 2 * Copyright (C) 2010-2013 Toni Gundogdu <legatvs@gmail.com> 3 * 4 * This program is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 3 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 #include <ccinternal> 19 20 #include <stdexcept> 21 #include <iostream> 22 #include <clocale> 23 24 #include <ccapplication> 25 #include <ccquvi> 26 27 using namespace cc; 28 main(int argc,char * argv[])29int main(int argc, char *argv[]) 30 { 31 setlocale(LC_ALL, ""); 32 application::exit_status es = application::ok; 33 application app; 34 try 35 { 36 es = app.exec(argc, argv); 37 } 38 // Thrown by quvi::query constructor (e.g. quvi_init failure). 39 catch (const quvi::error& e) 40 { 41 std::clog << "libquvi: error: " << e.what() << std::endl; 42 es = application::error; 43 } 44 // Thrown by boost (e.g. cc::go_background failure). 45 catch (const std::runtime_error& e) 46 { 47 std::clog << "error: " << e.what() << std::endl; 48 es = application::error; 49 } 50 // Thrown by boost::program_options (cc::options). 51 catch(const std::exception& e) 52 { 53 std::clog << "error: " << e.what() << std::endl; 54 es = application::error; 55 } 56 return es; 57 } 58 59 // vim: set ts=2 sw=2 tw=72 expandtab: 60