Boost logo

Boost :

From: christian.engstrom_at_[hidden]
Date: 2001-11-29 11:53:29


> 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.

I willingly concede that this syntax will probably look foreign to
many users as well, but, on the other hand, so will *any* syntax,
simply because there are so many different and incompatible variants
around out there.

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.

Others will no doubt disagree -- please don't flame me if I have made
disparaging remarks about your favorite platform :)


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