Boost logo

Boost Users :

Subject: Re: [Boost-users] Program options negative arguments
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2009-05-03 16:15:16


David Doria wrote:

> If I setup a multitoken option like this:
>
> desc.add_options()
> ("NumberList", po::value<vector<int> >()->multitoken(), "List of
> numbers.")
>
> and then call the program with:
> ./Program --NumberList 1 2 -3 4
>
> it treats the number "-3" as a new flag so it produces an "unknown option"
> error. Is there a way to handle this negative argument?

Use a command line style that does not think '-3' is an option. Multitoken
options are BAD, exactly because of these ambiguities.

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net