Skip to content
Permalink
Browse files
Add cmdline mode fuzzer
  • Loading branch information
LadyCailin committed May 15, 2020
1 parent afd97f9 commit 8ff888ddab97cb80deb1411eca1871b6c581efa0
Showing 1 changed file with 10 additions and 1 deletion.
@@ -128,7 +128,16 @@ public ArgumentSuiteResults match(String[] args, String defaultMode) throws Resu
if(suite.containsKey(mode)) {
return new ArgumentSuiteResults(mode, suite.get(mode), suite.get(mode).match(nonModeArgs));
} else {
throw new ModeNotFoundException("Mode " + mode + " was not found.");
String msg = "";
for(String key : suite.keySet()) {
if(StringUtils.LevenshteinDistance(key, mode) <= 2) {
if("".equals(msg)) {
msg = "\nDid you mean:\n";
}
msg += "\t" + key + "\n";
}
}
throw new ResultUseException("Mode " + mode + " was not found." + msg);
}
}

0 comments on commit 8ff888d

Please sign in to comment.