|
@@ -36,6 +36,11 @@ protected:
|
|
|
auto action(LongArg name, std::string const &description = "");
|
|
auto action(LongArg name, std::string const &description = "");
|
|
|
auto argument(size_t index, LongArg name,
|
|
auto argument(size_t index, LongArg name,
|
|
|
std::string const & description = "");
|
|
std::string const & description = "");
|
|
|
|
|
+ std::vector<std::string> rest(LongArg name = "args") {
|
|
|
|
|
+ rest_name_ = name;
|
|
|
|
|
+ size_t const i = std::min(arguments.size(), argument_names.size());
|
|
|
|
|
+ return {arguments.begin() + i, arguments.end()};
|
|
|
|
|
+ }
|
|
|
auto flag(LongArg name, std::string const & description = "");
|
|
auto flag(LongArg name, std::string const & description = "");
|
|
|
auto flag(LongArg name, char abbrev, std::string const & description = "");
|
|
auto flag(LongArg name, char abbrev, std::string const & description = "");
|
|
|
auto flag(char abbrev, std::string const & description = "");
|
|
auto flag(char abbrev, std::string const & description = "");
|
|
@@ -65,6 +70,7 @@ private:
|
|
|
using make_hook_t = std::function<main_callback_t(size_t, char const * const *)>;
|
|
using make_hook_t = std::function<main_callback_t(size_t, char const * const *)>;
|
|
|
// Metadata variables
|
|
// Metadata variables
|
|
|
bool primed_{false};
|
|
bool primed_{false};
|
|
|
|
|
+ std::string rest_name_;
|
|
|
std::map<option_id, std::string> argument_descriptions;
|
|
std::map<option_id, std::string> argument_descriptions;
|
|
|
std::map<size_t, option_id> argument_names;
|
|
std::map<size_t, option_id> argument_names;
|
|
|
std::map<option_id, std::string> option_descriptions;
|
|
std::map<option_id, std::string> option_descriptions;
|