From e2b8f68fcae70fca5971167613916a1aa9480817 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 25 Mar 2018 10:07:31 +0200 Subject: Document new command, use --vcs|-s instead of --no-git --- bdep/new-parsers.cxx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'bdep/new-parsers.cxx') 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:: + 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 (o, v, i); + } + else if (l == "none") + { + r.vcs = vcs::none; + r.none_opt = parse_options (o, v, i); + } + else + throw invalid_value (o, l); + + xs = true; + } } } -- cgit v1.1