diff --git a/include/popl.hpp b/include/popl.hpp index 8d8e27b..8e3a3c2 100644 --- a/include/popl.hpp +++ b/include/popl.hpp @@ -326,7 +326,8 @@ class OptionParser /// Parse the command line into the added Options /// @param argc command line argument count /// @param argv command line arguments - void parse(int argc, const char * const argv[]); + /// @param start_index index of starting argument + void parse(int argc, const char * const argv[], int start_index = 1); /// Produce a help message /// @param max_attribute show options up to this level (optional, advanced, expert) @@ -735,7 +736,7 @@ inline void Value::parse(OptionName what_name, const char* value) template -void Value::update_reference() +inline void Value::update_reference() { if (this->assign_to_) { @@ -916,14 +917,14 @@ inline std::shared_ptr OptionParser::get_option(char short_name) const } -inline void OptionParser::parse(int argc, const char * const argv[]) +inline void OptionParser::parse(int argc, const char * const argv[], int start_index) { unknown_options_.clear(); non_option_args_.clear(); for (auto& opt : options_) opt->clear(); - for (int n=1; n