1 //! \file BoostPoCommandLineParser.cpp
3 #include "BoostPoCommandLineParser.h"
7 BoostPoCommandLineParser::BoostPoCommandLineParser() :
8 cmdOptions("Allowed options"),
11 cmdOptions
.add_options()
12 ("version,v", "produce version message")
13 ("help,h", "produce help message")
14 ("dot-out,o", po::value
<std::string
>(), "file for dot output (unused)")
15 ("json-cache,j", po::value
<std::string
>(), "file for json cache file")
19 ("url", po::value
<std::string
>(), "URL")
20 //("url", po::value<vector<string>>(), "URL")
23 cmdline_options
.add(cmdOptions
).add(input
);
28 std::string
BoostPoCommandLineParser::getValue(std::string option
)
30 assert(hasSet(option
));
31 return vm
[option
].as
<std::string
>();
34 bool BoostPoCommandLineParser::hasSet(std::string flag
)
36 return vm
.count(flag
);
39 void BoostPoCommandLineParser::parse(int argc
, char** argv
)
41 // po::store(po::parse_command_line(argc, argv, desc), vm);
42 po::store(po::command_line_parser(argc
, argv
)
43 .options(cmdline_options
).positional(p
).run(), vm
);
47 void BoostPoCommandLineParser::printHelp()
49 std::cout
<< "Usage: walker [options] URL" << std::endl
;
50 std::cout
<< cmdOptions
<< std::endl
;