diff options
author | Evan Martin <martine@danga.com> | 2011-12-05 21:25:56 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-12-05 21:25:56 (GMT) |
commit | 78d717c2d6162aefaf3c386edfb22c39ec06d1c1 (patch) | |
tree | cf33661d68c4e3d1aed3792bb334025157a41aab /src/ninja.cc | |
parent | d7229a69272f2d994f14fa761fe086ba38acb588 (diff) | |
download | Ninja-78d717c2d6162aefaf3c386edfb22c39ec06d1c1.zip Ninja-78d717c2d6162aefaf3c386edfb22c39ec06d1c1.tar.gz Ninja-78d717c2d6162aefaf3c386edfb22c39ec06d1c1.tar.bz2 |
add help output to clean tool
Diffstat (limited to 'src/ninja.cc')
-rw-r--r-- | src/ninja.cc | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/ninja.cc b/src/ninja.cc index 616de81..86c9a59 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -410,17 +410,23 @@ int CmdClean(State* state, int argc, char* argv[], const BuildConfig& config) { optind = 1; int opt; - while ((opt = getopt(argc, argv, const_cast<char*>("gr"))) != -1) { + while ((opt = getopt(argc, argv, const_cast<char*>("hgr"))) != -1) { switch (opt) { - case 'g': - generator = true; - break; - case 'r': - clean_rules = true; - break; - default: - Usage(config); - return 1; + case 'g': + generator = true; + break; + case 'r': + clean_rules = true; + break; + case 'h': + default: + printf("usage: ninja -t clean [options] [targets]\n" +"\n" +"options:\n" +" -g also clean files marked as ninja generator output\n" +" -r interpret targets as a list of rules to clean instead\n" + ); + return 1; } } argv += optind; |