From 3049bb68e2dff4e22a678d36fcfe028d9fe10b92 Mon Sep 17 00:00:00 2001 From: Andrew D Smith Date: Fri, 26 Jul 2019 17:46:45 -0700 Subject: [PATCH] Added some comments --- OptionParser.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OptionParser.cpp b/OptionParser.cpp index b48a973..cac4cd0 100644 --- a/OptionParser.cpp +++ b/OptionParser.cpp @@ -237,11 +237,16 @@ Option::parse(vector &command_line) { format_option(command_line[i + 1]); } else { + // this will only work if it's a bool, because the + // format_option function will ignore the argument format_option(dummy); } specified = true; + // remove this option from the set of options command_line.erase(command_line.begin() + i); + // if there was an argument (i.e. non bool) then remove that + // argument also if (arg_type != SMITHLAB_ARG_BOOL) { command_line.erase(command_line.begin() + i); }