-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
38 lines (29 loc) · 861 Bytes
/
main.cpp
File metadata and controls
38 lines (29 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* Copyright (c) 2011-2012 Maroš Kasinec
* Licensed under the GNU General Public License v3.
* See COPYING for more information.
*/
#include "core.h"
#include "qt_gui.h"
#include "boost/program_options.hpp"
#include <string>
int main(int argc, char* argv[]) {
/*
* Program command options
*/
namespace po = boost::program_options;
po::options_description desc("Allowed options");
desc.add_options()
("help", "produce help message")
("homedir", po::value<std::string>(), "set home directory")
;
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
po::notify(vm);
if (vm.count("homedir")) {
chdir(vm["homedir"].as<std::string>().c_str());
}
sdc::Core::Create(new sdc::QtGui(argc, argv));
sdc::Core::Instance()->Start();
return sdc::Core::Instance()->GetReturnCode();
}