bool cmd_line::counted( option &opt, size_t &idx, const std::vector<char *> & ) { precondition( !opt.is_non_option(), "unnamed option not allowed as counted flag" ); opt.add_value( nullptr ); ++idx; return true; }
bool cmd_line::multi( option &opt, size_t &idx, const std::vector<char *> &args ) { if ( !opt.is_non_option() ) ++idx; if ( idx >= args.size() || args[idx][0] == '-' ) throw_runtime( "option '{0}' expected at least 1 value", opt.name() ); opt.add_value( args[idx] ); ++idx; return true; }