Skip to content

Commit

Permalink
Give a useful hint if the user runs "ninja clean" and there is no "cl…
Browse files Browse the repository at this point in the history
…ean" target
  • Loading branch information
pcc committed Mar 5, 2012
1 parent 2338d93 commit e92bbcb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/ninja.cc
Expand Up @@ -195,9 +195,13 @@ bool CollectTargetsFromArgs(State* state, int argc, char* argv[],
} else {
*err = "unknown target '" + path + "'";

Node* suggestion = state->SpellcheckNode(path);
if (suggestion) {
*err += ", did you mean '" + suggestion->path() + "'?";
if (path == "clean") {
*err += ", did you mean 'ninja -t clean'?";
} else {
Node* suggestion = state->SpellcheckNode(path);
if (suggestion) {
*err += ", did you mean '" + suggestion->path() + "'?";
}
}
return false;
}
Expand Down

0 comments on commit e92bbcb

Please sign in to comment.