#include "parseargs.hh" #include #include #include #include std::tuple parse_args(int t_ac, char **t_av) { namespace po = boost::program_options; po::options_description desc("Allowed options"); desc.add_options()("help,h", "Display this help message")( "input,i", po::value(), "Input image")( "output,o", po::value(), "Image or video output path")("video,v", "Enable video output"); po::variables_map vm; po::store(po::parse_command_line(t_ac, t_av, desc), vm); po::notify(vm); if (vm.count("help") || !vm.count("input")) { std::cout << desc << "\n"; std::exit(1); } return std::make_tuple(vm["input"].as(), (vm.count("output")) ? vm["output"].as() : vm["input"].as() + std::string{"_output"}, (vm.count("video")) ? true : false); }