diff options
author | Evan Martin <martine@danga.com> | 2012-08-13 18:39:32 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-08-13 18:39:32 (GMT) |
commit | 77b078b01f0a0262f5f0abe61ca73cd981fcd506 (patch) | |
tree | 4022582277adf8fc7057ab6326da89dbc2753c40 /src/ninja.cc | |
parent | ee625b0b8a16a3182bf1e0531c81f846ef9f4df9 (diff) | |
download | Ninja-77b078b01f0a0262f5f0abe61ca73cd981fcd506.zip Ninja-77b078b01f0a0262f5f0abe61ca73cd981fcd506.tar.gz Ninja-77b078b01f0a0262f5f0abe61ca73cd981fcd506.tar.bz2 |
rename -V to --version and clean up --help output
Diffstat (limited to 'src/ninja.cc')
-rw-r--r-- | src/ninja.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/ninja.cc b/src/ninja.cc index b645b90..00bd104 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -77,14 +77,12 @@ void Usage(const BuildConfig& config) { "usage: ninja [options] [targets...]\n" "\n" "if targets are unspecified, builds the 'default' target (see manual).\n" -"targets are paths, with additional special syntax:\n" -" 'target^' means 'the first output that uses target'.\n" -" example: 'ninja foo.cc^' will likely build foo.o.\n" "\n" "options:\n" +" --version print ninja version (\"%s\")\n" +"\n" " -C DIR change to DIR before doing anything else\n" " -f FILE specify input build file [default=build.ninja]\n" -" -V print ninja version (\"%s\")\n" "\n" " -j N run N jobs in parallel [default=%d]\n" " -l N do not start new jobs if the load average is greater than N\n" @@ -92,13 +90,12 @@ void Usage(const BuildConfig& config) { " (not yet implemented on Windows)\n" #endif " -k N keep going until N jobs fail [default=1]\n" -" -n dry run (don't run commands but pretend they succeeded)\n" +" -n dry run (don't run commands but act like they succeeded)\n" " -v show all command lines while building\n" "\n" " -d MODE enable debugging (use -d list to list modes)\n" -" -t TOOL run a subtool\n" -" use '-t list' to list subtools.\n" -" terminates toplevel options; further flags are passed to the tool.\n", +" -t TOOL run a subtool (use -t list to list subtools)\n" +" terminates toplevel options; further flags are passed to the tool\n", kVersion, config.parallelism); } @@ -649,8 +646,10 @@ int NinjaMain(int argc, char** argv) { globals.config.parallelism = GuessParallelism(); + enum { OPT_VERSION = 1 }; const option kLongOptions[] = { { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, OPT_VERSION }, { NULL, 0, NULL, 0 } }; @@ -701,7 +700,7 @@ int NinjaMain(int argc, char** argv) { case 'C': working_dir = optarg; break; - case 'V': + case OPT_VERSION: printf("%s\n", kVersion); return 0; case 'h': |