aboutsummaryrefslogtreecommitdiff
path: root/bdep/utility.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-09-06 08:28:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-09-06 10:57:44 +0200
commit09b1d3ff6e0d0db3210207b94c6106ea647e9318 (patch)
tree187d21d22955e145f1a8ffd376d773da4ad7b210 /bdep/utility.hxx
parent8f1a2ab7bd19e0f4bdf7f173c20078df96b0e12d (diff)
Add argument grouping support for dependencies in bdep-{sync,init}
Diffstat (limited to 'bdep/utility.hxx')
-rw-r--r--bdep/utility.hxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/bdep/utility.hxx b/bdep/utility.hxx
index d5e98c8..8e3ca3c 100644
--- a/bdep/utility.hxx
+++ b/bdep/utility.hxx
@@ -303,6 +303,26 @@ namespace bdep
return r;
}
+ namespace cli
+ {
+ class vector_group_scanner: public group_scanner
+ {
+ public:
+ explicit
+ vector_group_scanner (const std::vector<std::string>& args)
+ : group_scanner (scan_), scan_ (args) {}
+
+ void
+ skip_group ()
+ {
+ for (scanner& g (group ()); g.more (); g.skip ()) ;
+ }
+
+ private:
+ vector_scanner scan_;
+ };
+ }
+
// Verify that a string is a valid UTF-8 byte sequence encoding only the
// graphic Unicode codepoints. Issue diagnostics (including a suggestion to
// use option opt, if specified) and fail if that's not the case.