From 234428e21adde0ddf60f9665edad3dcfb9fd2584 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 24 Mar 2018 13:29:06 +0200 Subject: Implement --config-create|-C in init and new --- bdep/bdep.cxx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'bdep/bdep.cxx') diff --git a/bdep/bdep.cxx b/bdep/bdep.cxx index 05fcc47..1f9c2ca 100644 --- a/bdep/bdep.cxx +++ b/bdep/bdep.cxx @@ -49,6 +49,7 @@ cfg_name (configuration_name_options* o, const char* a) fail << "empty configuration name"; o->config_name ().push_back (move (n)); + o->config_name_specified (true); return true; } @@ -72,32 +73,30 @@ init (const common_options& co, cli::scanner& scan, strings& args) { if (opt) { + const char* a (scan.peek ()); + // If we see first "--", then we are done parsing options. // - if (strcmp (scan.peek (), "--") == 0) + if (strcmp (a, "--") == 0) { scan.next (); opt = false; continue; } - // Parse the next chunk of options until we reach an argument (or eos). - // - o.parse (scan); - - if (!scan.more ()) - break; - // @ // - const char* a (scan.peek ()); - if (*a == '@' && cfg_name (&o, a + 1)) { scan.next (); continue; } + // Parse the next chunk of options until we reach an argument (or eos). + // + if (o.parse (scan)) + continue; + // Fall through. } -- cgit v1.1