Boost logo

Boost :

From: David A. Greene (greened_at_[hidden])
Date: 2001-11-29 12:39:12

christian.engstrom_at_[hidden] wrote:

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

Absolutely! As I mentioned earlier on in this thread, I have found
this sort of thing incredibly useful. It's great for passing
arguments to plugins, for example.

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

Concerns about () on UNIX have already been raised. While it may be
unusual to quote arguments, in practice I have not found it to be
a problem. It does take some getting used to, but users have the
same problem with find, grep, etc. because the regexp often must
be quoted.

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

I'm in total agreement here. Here's a question we should ask
ourselves: is the goal of a Boost argument parsing library to
replace parsers in existing programs or to be used for parsing
arguments in new programs? I would think mainly the latter
and in that case settling on one (or a few) argument styles
may not be such a bad thing after all. It would at least
encourage consistency. :)


"Some little people have music in them, but Fats, he was all music,
  and you know how big he was."  --  James P. Johnson

Boost list run by bdawes at, gregod at, cpdaniel at, john at