On 4/24/06, pb firstname.lastname@example.org wrote:
"The Gnu and the Unix option types can be mixed on the same commandline.
CommandLine is established code. Where did I wander off the path?
Nope. You understood correctly. I am afraid that you have found the soft
underbelly of CommandLine. That behavior used to be supported, but was
So, in short, the documentation has lied to you.
The problem comes about from trying to support too many different option
so at the time, they were removed so we could make a timely release. So
the first that wanted to mix the two. There shouldn’t be a problem
this feature, but we would need to add a check to test for legal
If you want to provide a patch I am more that willing to add it in.
Or, you can wait on me. Not sure when I can get around to this,
but I think it should be done.
Let me provide a little history of the problem.
The three option styles are Gnu, XTools and Posix.
Other than syntax, there is also functional features of each.
Gnu and XTools can always be abbreviated. That is, the option
“–fred” can be represented as “–fre”, “–fr”, or “–f”, if any of
are unique. The same holds for XTools, “-fred” can be represented
as “-fre”, “-fr” or “-f”. This feature is always on and cannot be turned
The functional feature of Posix is that the options “-a” and “-b” can be
written as “-ab” or as “-ba”. Supporting this with XTools could get
so we have opted not to support this.
If the Posix functional feature of combining options is turned off, then
all three may be combined in the same set of options. CommandLine
prefers this since it doesn’t want to limit how you define options.
But, if we turn the Posix combining feature on, we have the following
gnu, xtools - ok
gnu, posix - ok
posix, xtools - illegal
gnu, posix, xtools - illegal
To implement this change, application.rb and optionparser.rb will need
modified (and possibly option.rb).
So, please help me out here on the interface.
Most people will use gnu style options with the posix style short
If the options list only contains gnu and posix style options, should
be on by default? How should posix be turned on and off?