aboutsummaryrefslogtreecommitdiff
path: root/bdep/new-parsers.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-03-25 10:07:31 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-03-25 10:07:31 +0200
commite2b8f68fcae70fca5971167613916a1aa9480817 (patch)
tree3e4b63695de7855d71082aa1abd090e10825de2a /bdep/new-parsers.cxx
parent234428e21adde0ddf60f9665edad3dcfb9fd2584 (diff)
Document new command, use --vcs|-s instead of --no-git
Diffstat (limited to 'bdep/new-parsers.cxx')
-rw-r--r--bdep/new-parsers.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/bdep/new-parsers.cxx b/bdep/new-parsers.cxx
index d5b8e6e..effa2a7 100644
--- a/bdep/new-parsers.cxx
+++ b/bdep/new-parsers.cxx
@@ -12,6 +12,7 @@ namespace bdep
{
using type = cmd_new_type;
using lang = cmd_new_lang;
+ using vcs = cmd_new_vcs;
// Parse comma-separated list of of options starting from the first comma
// at pos.
@@ -110,5 +111,33 @@ namespace bdep
xs = true;
}
+
+ void parser<vcs>::
+ parse (vcs& r, bool& xs, scanner& s)
+ {
+ const char* o (s.next ());
+
+ if (!s.more ())
+ throw missing_value (o);
+
+ string v (s.next ());
+ size_t i (v.find (','));
+ string l (v, 0, i);
+
+ if (l == "git")
+ {
+ r.vcs = vcs::git;
+ r.git_opt = parse_options<cmd_new_git_options> (o, v, i);
+ }
+ else if (l == "none")
+ {
+ r.vcs = vcs::none;
+ r.none_opt = parse_options<cmd_new_none_options> (o, v, i);
+ }
+ else
+ throw invalid_value (o, l);
+
+ xs = true;
+ }
}
}