summaryrefslogtreecommitdiff
path: root/cli/runtime-header.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cli/runtime-header.cxx')
-rw-r--r--cli/runtime-header.cxx19
1 files changed, 15 insertions, 4 deletions
diff --git a/cli/runtime-header.cxx b/cli/runtime-header.cxx
index 9861166..9f92262 100644
--- a/cli/runtime-header.cxx
+++ b/cli/runtime-header.cxx
@@ -246,7 +246,13 @@ generate_runtime_header (context& ctx)
// scanner
//
- os << "class scanner"
+ os << "// Command line argument scanner interface." << endl
+ << "//" << endl
+ << "// The values returned by next() are guaranteed to be valid" << endl
+ << "// for the two previous arguments up until a call to a third" << endl
+ << "// peek() or next()." << endl
+ << "//" << endl
+ << "class scanner"
<< "{"
<< "public:" << endl
<< "virtual" << endl
@@ -396,11 +402,16 @@ generate_runtime_header (context& ctx)
<< "const option_info* options_;"
<< "std::size_t options_count_;"
<< endl
- << "std::string hold_;"
- << "std::deque<std::string> args_;";
+ << "std::deque<std::string> args_;"
+ << endl
+ << "// Circular buffer of two arguments." << endl
+ << "//" << endl
+ << "std::string hold_[2];"
+ << "std::size_t i_;";
if (!ctx.opt_sep.empty ())
- os << "bool skip_;";
+ os << endl
+ << "bool skip_;";
os << "};";
}