diff options
author | 2011-12-27 17:30:35 +0900 | |
---|---|---|
committer | 2011-12-28 16:04:19 +0900 | |
commit | 003b8cf9e6e8e975f53b8e375c4b20064bfb8c4a (patch) | |
tree | 57a144ad9746fc97467518693bd00b73f5af8eea | |
parent | 8b6f788e18844b281b80256c91c35573fcd97946 (diff) | |
download | latinime-003b8cf9e6e8e975f53b8e375c4b20064bfb8c4a.tar.gz latinime-003b8cf9e6e8e975f53b8e375c4b20064bfb8c4a.tar.xz latinime-003b8cf9e6e8e975f53b8e375c4b20064bfb8c4a.zip |
Error out when given an unknown argument
Bug: 5802658
Change-Id: I3a3871f17a5001dc61e835111944d35540aa5bcd
-rw-r--r-- | tools/makedict/src/com/android/inputmethod/latin/DictionaryMaker.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/makedict/src/com/android/inputmethod/latin/DictionaryMaker.java b/tools/makedict/src/com/android/inputmethod/latin/DictionaryMaker.java index 1ba01075e..afd602308 100644 --- a/tools/makedict/src/com/android/inputmethod/latin/DictionaryMaker.java +++ b/tools/makedict/src/com/android/inputmethod/latin/DictionaryMaker.java @@ -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"); } } } |