File tree Expand file tree Collapse file tree
src/test/org/apache/commons/cli Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 * version 1.1, a copy of which has been included with this distribution in
66 * the LICENSE file.
77 *
8- * $Id: BugsTest.java,v 1.12 2002/11/25 23:43:41 jkeyes Exp $
8+ * $Id: BugsTest.java,v 1.13 2003/01/13 08:17:26 jkeyes Exp $
99 */
1010
1111package org .apache .commons .cli ;
@@ -361,4 +361,20 @@ public void test14786() {
361361 }
362362 }
363363
364+ public void test15046 () throws Exception {
365+ CommandLineParser parser = new PosixParser ();
366+ final String [] CLI_ARGS = new String [] {"-z" , "c" };
367+ Option option = new Option ("z" , "timezone" , true ,
368+ "affected option" );
369+ Options cliOptions = new Options ();
370+ cliOptions .addOption (option );
371+ parser .parse (cliOptions , CLI_ARGS );
372+
373+ //now add conflicting option
374+ cliOptions .addOption ("c" , "conflict" , true , "conflict option" );
375+ CommandLine line = parser .parse (cliOptions , CLI_ARGS );
376+ assertEquals ( option .getValue (), "c" );
377+ assertTrue ( !line .hasOption ("c" ) );
378+ }
379+
364380}
You can’t perform that action at this time.
0 commit comments