Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions include/popl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -735,7 +736,7 @@ inline void Value<T>::parse(OptionName what_name, const char* value)


template<class T>
void Value<T>::update_reference()
inline void Value<T>::update_reference()
{
if (this->assign_to_)
{
Expand Down Expand Up @@ -916,14 +917,14 @@ inline std::shared_ptr<T> 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<argc; ++n)
for (int n=start_index; n<argc; ++n)
{
const std::string arg(argv[n]);
if (arg == "--")
Expand Down