File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/cli/bug Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,14 +126,15 @@ public void test11458() throws Exception {
126126 @ Test
127127 public void test11680 () throws Exception {
128128 final Options options = new Options ();
129- options .addOption ("f" , true , "foobar" );
130- options .addOption ("m" , true , "missing" );
129+ final Option optionF = options .addOption ("f" , true , "foobar" ). getOption ( "f " );
130+ final Option optionM = options .addOption ("m" , true , "missing" ). getOption ( "m " );
131131 final String [] args = {"-f" , "foo" };
132-
133132 final CommandLineParser parser = new PosixParser ();
134-
135133 final CommandLine cmd = parser .parse (options , args );
136-
134+ // 1.5.0 API:
135+ cmd .getOptionValue (optionF , "default f" );
136+ cmd .getOptionValue (optionM , "default m" );
137+ // Original API:
137138 cmd .getOptionValue ("f" , "default f" );
138139 cmd .getOptionValue ("m" , "default m" );
139140 //
You can’t perform that action at this time.
0 commit comments