We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 47c2a28 commit a6f9d7bCopy full SHA for a6f9d7b
1 file changed
src/main/java/org/apache/commons/cli/DefaultParser.java
@@ -716,17 +716,14 @@ private List<String> getMatchingLongOptions(final String token)
716
{
717
return options.getMatchingOptions(token);
718
}
719
- else
+ final List<String> matches = new ArrayList<>(1);
720
+ if (options.hasLongOption(token))
721
- final List<String> matches = new ArrayList<>(1);
722
- if (options.hasLongOption(token))
723
- {
724
- final Option option = options.getOption(token);
725
- matches.add(option.getLongOpt());
726
- }
727
-
728
- return matches;
+ final Option option = options.getOption(token);
+ matches.add(option.getLongOpt());
729
+
+ return matches;
730
731
732
/**
0 commit comments