Guest User

Untitled

a guest
Jan 18th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. namespace po = boost::program_options;
  2. po::options_description desc("Allowed options");
  3. desc.add_options()
  4. ("option1", po::value<int>(&int1), "set value for option1")
  5. ("option2", po::value<int>(&int2)->default_value(int1), "set value for option2, default is option1")
  6. ;
  7.  
  8. po::variables_map vm;
  9. po::store(po::parse_command_line(argc, argv, desc), vm);
  10. po::notify(vm);
  11.  
  12. if (vm.count("config")) {
  13. std::ifstream cfs(config_file, std::ifstream::in);
  14. po::store(po::parse_config_file(cfs, desc), vm);
  15. po::notify(vm);
  16. }
Add Comment
Please, Sign In to add comment