We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 583aeda commit 14c4903Copy full SHA for 14c4903
1 file changed
src/main/java/org/apache/commons/cli/Options.java
@@ -225,11 +225,8 @@ public List<String> getMatchingOptions(String opt) {
225
public Option getOption(String opt) {
226
opt = Util.stripLeadingHyphens(opt);
227
228
- if (shortOpts.containsKey(opt)) {
229
- return shortOpts.get(opt);
230
- }
231
-
232
- return longOpts.get(opt);
+ final Option option = shortOpts.get(opt);
+ return option != null ? option : longOpts.get(opt);
233
}
234
235
/**
0 commit comments