An option argument is allowed in a shot option cluster #7

Merged
merged 4 commits into from Oct 19, 2011

Projects

None yet

2 participants

@alanvdam

Hey,

Currently we are using the jopt-simple library in a project. We are replacing an old c system that accepts an option argument that is in a clustered option set. Which getOpt is doing as well I think.
Maybe you could pull this?

Cheers,
Alan

@pholser
Owner

Thanks for submitting this -- I'd considered allowing what you describe, but I think I held off on bringing it in because I thought it simpler to restrict short option clusters to those options which do not accept arguments.

Can you add an example to src/site/resources/examples.vm that shows the differences between how JOpt Simple behaves regarding short option clusters prior to your enhancement and after it?

Also -- is there any risk of introducing ambiguity? That is, might a given combination of configured parser and command line options be interpreted in more than one way? I want to be clear about how such potential ambiguities are sorted out. If you can think of such ambiguities, tests that demonstrate which interpretation wins would be very helpful also.

I appreciate your contribution!

@pholser
Owner

Never mind -- I'll go ahead and do this. Thanks!

@alanvdam

Cool! Just added a short example. Thanks.

@pholser pholser merged commit 037906f into pholser:master Oct 19, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment