Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace po = boost::program_options;
- po::options_description desc("Allowed options");
- desc.add_options()
- ("option1", po::value<int>(&int1), "set value for option1")
- ("option2", po::value<int>(&int2)->default_value(int1), "set value for option2, default is option1")
- ;
- po::variables_map vm;
- po::store(po::parse_command_line(argc, argv, desc), vm);
- po::notify(vm);
- if (vm.count("config")) {
- std::ifstream cfs(config_file, std::ifstream::in);
- po::store(po::parse_config_file(cfs, desc), vm);
- po::notify(vm);
- }
Add Comment
Please, Sign In to add comment