Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2002-01-21 07:06:25


HartmutKaiser_at_[hidden] wrote:
> Vladimir Prus wrote:
> > "-bar" can be interpreted, depending on the styles user wants
> > as either:
> > 1) Three short options
> > 2) Short option followed by parameter
> > 3) Long option
> > Can you give an *example* of how this can be handled with Spirit.
>
> char const *option_to_parse = "-your_option_here";
> char const *end_of_option = option_to_parse+strlen(option_to_parse);
>
> // 1) Three short options
[snip]
> // 2) Short option followed by parameter
[snip]
> // 3) Long option
[snip]

And how do I specify that "-xy" should be treated as two options when 'x'
takes no parameter and as an option with parameter otherwise? How will I
detect the case when there short option "f" and there's long option "foo", in
which case "-f" can mean either the short option or the abbreviated long one?

- Volodya


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