aboutsummaryrefslogtreecommitdiff
path: root/bdep/bdep.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-03-24 13:29:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-03-24 13:29:06 +0200
commit234428e21adde0ddf60f9665edad3dcfb9fd2584 (patch)
tree28910fd2556f2c6b985762710a3319b981aa151e /bdep/bdep.cxx
parentefc78a6f3b0d1e0a2278ea5a7f2c502a6b4f00d0 (diff)
Implement --config-create|-C in init and new
Diffstat (limited to 'bdep/bdep.cxx')
-rw-r--r--bdep/bdep.cxx19
1 files changed, 9 insertions, 10 deletions
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;
-
// @<cfg-name>
//
- 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.
}