Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2001-12-03 08:39:22


williamkempf_at_[hidden] wrote:
> > The only problem with interspersing options
> > and arguments is ambiguity arising with optional parameters.
> > "--foo bar" can mean two different things if "foo" takes optional
> > parameter.
> > Should we be greedy in this case?

> I never looked at your implementation so I wasn't commenting directly
> on what you support or don't. However, the ambiguity you point out
> above is precisely why I think we need the lower level interface as
> well.
I agree. And in fact, I've tried to make parser interface relatively simple
and low-level -- basically, parser returns
vector< pair<string /*option*/, string /*argument*/> >. If even this is found
to be too high level, it can be simplified further.

> In general interspersing options with arguments can't be done
> because of these ambiguities, and so higher level interfaces can't
> support this. However, it's often possible to handle the ambiguities
> directly which is easily done using the interface in the code I
> uploaded.
Here I don't understand. How direct handling of ambiguiities is supposed to
work?

> > I have slightly different position. IMO, there should be one
> > default style.
> > If developers want different style of different OSes, they pass
> > some flags
> > explicitly.
>
> That's only slightly different then my position. My position is that
> when I'm writing a program for platform X it should be EXTREMELY
> trivial to have the parser behave as if coded for that platform. If
> I have to pass 3 or more options to make it behave this way then the
> library is getting in my way. That doesn't mean that I expect the
> program to take / as the argument on Windows but - and -- on Unix.
> Portable programs should pick a style and use it consistently on all
> platforms.
We're in agreement here.

- Volodya


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