commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <>
Subject [jira] Commented: (CLI-12) [cli] Not handling property=value followed by 'remaining' args
Date Mon, 10 Jul 2006 07:02:31 GMT
    [ ] 

Henri Yandell commented on CLI-12:

Probably not for a few months at the best - the CLI-2 API was designed as an overhaul of the
CLI-1 API but failed to get released before the developers went inactive. Hopefully we're
on the way to getting it restarted now. You can grab a nightly build from the following URL

> [cli] Not handling property=value followed by 'remaining' args
> --------------------------------------------------------------
>          Key: CLI-12
>          URL:
>      Project: Commons CLI
>         Type: Bug

>  Environment: Operating System: other
> Platform: Other
>     Reporter: Jim Skufca
>  Attachments:, arg_pattern.patch
> If you have a command line args similar to
> domything -Dmyprop1=myval1 -Dmyprop2=myval2 myfile
> I would expect to be able to set up the 'D' option so that 
>  String[] opts = line.getOptionValues( "D" );
>  assertEquals( "myprop1", opts[0] );
>  assertEquals( "myval1", opts[1] );
>  assertEquals( "myprop2", opts[2] );
>  assertEquals( "myval2", opts[3] );
>  String[] xtraArgs = line.getArgs();
>  assertEquals( "myfile", xtraArgs[0]);
> But, setting up similar to the I get 'myfile' as opts
> [4].  Since we have set up the 'D' option with hasArgs, it will only stop 
> adding args to 'D' when it runs into another valid option, not an extra arg.  
> If you set up the 'D' option with hasArg (singular) then it myprop1=myval1 
> gets reported as an invalid option.
> I've glanced at the source but didn't see an obvious fix that wouldn't 
> jeopardize the combinations and permutations that Option.addValue() must deal 
> with.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message