Permalink
Browse files

Merge pull request #522 from nico/spelldebug

Add spell checking for debug flags.
  • Loading branch information...
2 parents 543f3ed + 61f4a99 commit e2e7a18953723e678b5280a4525ab8173fec08c9 @evmar evmar committed Mar 28, 2013
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/ninja.cc
View
@@ -629,7 +629,14 @@ bool DebugEnable(const string& name, Globals* globals) {
g_explaining = true;
return true;
} else {
- printf("ninja: unknown debug setting '%s'\n", name.c_str());
+ const char* suggestion =
+ SpellcheckString(name, "stats", "explain", NULL);
+ if (suggestion) {
+ Error("unknown debug setting '%s', did you mean '%s'?",
+ name.c_str(), suggestion);
+ } else {
+ Error("unknown debug setting '%s'", name.c_str());
+ }
return false;
}
}

0 comments on commit e2e7a18

Please sign in to comment.