diff options
author | Nico Weber <nicolasweber@gmx.de> | 2012-09-14 04:14:16 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2012-09-14 04:14:16 (GMT) |
commit | 5fdb12ed5cec4e1c853c64026142d088ff5519e1 (patch) | |
tree | e5ea08fc48792b5c757afa0d992199195405c080 /src/ninja.cc | |
parent | 06fa62352d1e9868409b299ffc8abc8f4cd9a39d (diff) | |
download | Ninja-5fdb12ed5cec4e1c853c64026142d088ff5519e1.zip Ninja-5fdb12ed5cec4e1c853c64026142d088ff5519e1.tar.gz Ninja-5fdb12ed5cec4e1c853c64026142d088ff5519e1.tar.bz2 |
Clean up getopt_long call.
Remove now-unimplemented 'V' from getopt_long. Remove 'h', since it's
included in the long options. Order switch cases in the same order as in
the getopt_long argument.
Diffstat (limited to 'src/ninja.cc')
-rw-r--r-- | src/ninja.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/ninja.cc b/src/ninja.cc index ad56f1c..c9196f8 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -740,7 +740,7 @@ int NinjaMain(int argc, char** argv) { int opt; while (tool_name.empty() && - (opt = getopt_long(argc, argv, "d:f:hj:k:l:nt:vC:V", kLongOptions, + (opt = getopt_long(argc, argv, "d:f:j:k:l:nt:vC:", kLongOptions, NULL)) != -1) { switch (opt) { case 'd': @@ -753,14 +753,6 @@ int NinjaMain(int argc, char** argv) { case 'j': config.parallelism = atoi(optarg); break; - case 'l': { - char* end; - double value = strtod(optarg, &end); - if (end == optarg) - Fatal("-l parameter not numeric: did you mean -l 0.0?"); - config.max_load_average = value; - break; - } case 'k': { char* end; int value = strtol(optarg, &end, 10); @@ -773,15 +765,23 @@ int NinjaMain(int argc, char** argv) { config.failures_allowed = value > 0 ? value : INT_MAX; break; } + case 'l': { + char* end; + double value = strtod(optarg, &end); + if (end == optarg) + Fatal("-l parameter not numeric: did you mean -l 0.0?"); + config.max_load_average = value; + break; + } case 'n': config.dry_run = true; break; - case 'v': - config.verbosity = BuildConfig::VERBOSE; - break; case 't': tool_name = optarg; break; + case 'v': + config.verbosity = BuildConfig::VERBOSE; + break; case 'C': working_dir = optarg; break; |