Skip to content
Snippets Groups Projects
Commit 3a4f6b53 authored by Jean Chalard's avatar Jean Chalard Committed by Android (Google) Code Review
Browse files

Merge "Error out when given an unknown argument"

parents 4c34454a 003b8cf9
No related branches found
No related tags found
No related merge requests found
......@@ -105,7 +105,8 @@ public class DictionaryMaker {
} else {
// All these options need an argument
if (args.isEmpty()) {
throw new RuntimeException("Option " + arg + " requires an argument");
throw new IllegalArgumentException("Option " + arg + " is unknown or "
+ "requires an argument");
}
String filename = args.get(0);
args.remove(0);
......@@ -121,6 +122,8 @@ public class DictionaryMaker {
outputBinary = filename;
} else if (OPTION_OUTPUT_XML.equals(arg)) {
outputXml = filename;
} else {
throw new IllegalArgumentException("Unknown option : " + arg);
}
}
} else {
......@@ -133,7 +136,7 @@ public class DictionaryMaker {
} else if (null == outputBinary) {
outputBinary = arg;
} else {
throw new RuntimeException("Several output binary files specified");
throw new IllegalArgumentException("Several output binary files specified");
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment