Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(char **args) {
- CArgsParser parser;
- COptionBuilder builder;
- const std::string FIN_OPTION_LONG_NAME = "fin";
- const char FIN_OPTION_SHORT_NAME = 'i';
- builder.addShortName(FIN_OPTION_SHORT_NAME)
- builder.addLongName(FIN_OPTION_LONG_NAME)
- parser.addOption(builder.build());
- builder.reset();
- // Add more options here...
- try {
- parser.parse(args);
- } catch (std::exception& e) {
- std::cerr << e.what() << std::endl;
- return 1;
- }
- std::string input_file_name = parser.getOptionValue(FIN_OPTION_LONG_NAME);
- // OR
- std::string input_file_name_2 = parser.getOptionValue(FIN_OPTION_SHORT_NAME);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement