aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-09-20 21:33:48 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-09-22 17:50:27 +0300
commit32b728b7e9ef2505220e8a4d7dffb4bfda94e16e (patch)
treec14548f6de2582ac7ee26a45def7b3b2a4beaaed
parent3c31e984adfd4099c4c8aebd04f4c44b978f6e2d (diff)
Optimize options/arguments parsing
-rw-r--r--build2/b.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/build2/b.cxx b/build2/b.cxx
index 8e9b154..f0f5a7a 100644
--- a/build2/b.cxx
+++ b/build2/b.cxx
@@ -280,6 +280,12 @@ main (int argc, char* argv[])
{
if (opt)
{
+ // Parse the next chunk of options until we reach an argument (or
+ // eos).
+ //
+ if (ops.parse (scan) && !scan.more ())
+ break;
+
// If we see first "--", then we are done parsing options.
//
if (strcmp (scan.peek (), "--") == 0)
@@ -289,12 +295,6 @@ main (int argc, char* argv[])
continue;
}
- // Parse the next chunk of options until we reach an argument (or
- // eos).
- //
- if (ops.parse (scan))
- continue;
-
// Fall through.
}