summaryrefslogtreecommitdiff
path: root/cli/options.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'cli/options.hxx')
-rw-r--r--cli/options.hxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/cli/options.hxx b/cli/options.hxx
index cc9d897..a3dffd2 100644
--- a/cli/options.hxx
+++ b/cli/options.hxx
@@ -224,6 +224,12 @@ namespace cli
std::string argument_;
};
+ // Command line argument scanner interface.
+ //
+ // The values returned by next() are guaranteed to be valid
+ // for the two previous arguments up until a call to a third
+ // peek() or next().
+ //
class scanner
{
public:
@@ -335,8 +341,13 @@ namespace cli
const option_info* options_;
std::size_t options_count_;
- std::string hold_;
std::deque<std::string> args_;
+
+ // Circular buffer of two arguments.
+ //
+ std::string hold_[2];
+ std::size_t i_;
+
bool skip_;
};