Boost logo

Boost :

From: George A. Heintzelman (georgeh_at_[hidden])
Date: 2001-11-29 12:11:26


> > This means that you can't have an option that takes multiple
> > parameters:
> >
> > --foo bar1 bar2
> >
> > You can get tricky with the parsing by also requiring commas
> > between parameters:
> >
> > --foo=bar1,bar2
> >
> > But now the syntax is becoming foreign to most users. I'm not sure
> > I like that.
>
> My own personal preference for handling multiple arguments to an
> option would be to have them enclosed in parentheses, like this:
>
> --foo = (bar1 bar2)
>
> One could discuss if there should be commas between the arguments
> within the parentheses (as in the syntax used under VAX/VMS) or not.
> Personally, I would be just as happy to leave them out: they are not
> really necessary, and if you leave them out, you open up the
> possibility to use the command line parser recursively, since
> the "arg1 arg2 ..." part within the parentheses will look remarkably
> similar to the "par1 par2 ..." parameters in the command line itself.

The problem with this suggestion is that parentheses are significant to
just about every Unix shell out there, and so you'd be forcing Unix
users to type the rather uglier-looking --foo = \( bar1 bar2 \)
instead. So I think this is not going to work in general.

> I should probably also mention that I am quite likely to be biased in
> my opinions, due to the fact that I have been using VMS as my primary
> platform for over 15 years, and have yet to come to terms with what I
> see as a shocking lack of consistency across different programs on
> both the MS-DOS and Unix platforms.

The consistency of VMS arguments is certainly one of its strong points.
I would love to see it happen in Unix/MS-dos too, but I doubt it ever
will now.

Consistence across platforms would also be nice, though somewhat more
problematic (if such a thing is possible). Certainly one has to deal
with the fact that Unix style tends to the concise (to, or past, the
point of incomprehensibility), whereas VMS style tends to be verbose
(to, or past, the point of tediousness). A *really* good argument
parser would be able to deal with these cultural differences in a
consistent way. Maybe I'm dreaming though.

George Heintzelman
georgeh_at_[hidden]


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk