summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2011-12-05 21:25:56 (GMT)
committerEvan Martin <martine@danga.com>2011-12-05 21:25:56 (GMT)
commit78d717c2d6162aefaf3c386edfb22c39ec06d1c1 (patch)
treecf33661d68c4e3d1aed3792bb334025157a41aab /src
parentd7229a69272f2d994f14fa761fe086ba38acb588 (diff)
downloadNinja-78d717c2d6162aefaf3c386edfb22c39ec06d1c1.zip
Ninja-78d717c2d6162aefaf3c386edfb22c39ec06d1c1.tar.gz
Ninja-78d717c2d6162aefaf3c386edfb22c39ec06d1c1.tar.bz2
add help output to clean tool
Diffstat (limited to 'src')
-rw-r--r--src/ninja.cc26
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;