Returns the value of the given option, if it was given. Returns null if the option wasn't given, or if the option doesn't take a value (in which case you should use #has instead). @param name The name of the option to recognize (e.g. --foo). @throws IllegalArgumentException i
(final String name)
| 180 | * @throws IllegalStateException if {@link #parse} wasn't called. |
| 181 | */ |
| 182 | public String get(final String name) { |
| 183 | if (!options.containsKey(name)) { |
| 184 | throw new IllegalArgumentException("Unknown option " + name); |
| 185 | } else if (parsed == null) { |
| 186 | throw new IllegalStateException("parse() wasn't called"); |
| 187 | } |
| 188 | return parsed.get(name); |
| 189 | } |
| 190 | |
| 191 | /** |
| 192 | * Returns the value of the given option, or a default value. |
no outgoing calls
no test coverage detected