File tree Expand file tree Collapse file tree
src/main/java/org/apache/commons/cli Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,22 +62,18 @@ public class Options implements Serializable {
6262 */
6363 public Options addOption (final Option opt ) {
6464 final String key = opt .getKey ();
65-
6665 // add it to the long option list
6766 if (opt .hasLongOpt ()) {
6867 longOpts .put (opt .getLongOpt (), opt );
6968 }
70-
7169 // if the option is required add it to the required list
7270 if (opt .isRequired ()) {
7371 if (requiredOpts .contains (key )) {
7472 requiredOpts .remove (requiredOpts .indexOf (key ));
7573 }
7674 requiredOpts .add (key );
7775 }
78-
7976 shortOpts .put (key , opt );
80-
8177 return this ;
8278 }
8379
@@ -143,17 +139,14 @@ public Options addOptionGroup(final OptionGroup group) {
143139 if (group .isRequired ()) {
144140 requiredOpts .add (group );
145141 }
146-
147142 for (final Option option : group .getOptions ()) {
148143 // an Option cannot be required if it is in an
149144 // OptionGroup, either the group is required or
150145 // nothing is required
151146 option .setRequired (false );
152147 addOption (option );
153-
154148 optionGroups .put (option .getKey (), group );
155149 }
156-
157150 return this ;
158151 }
159152
You can’t perform that action at this time.
0 commit comments