As I saw elsewhere today, I'm new here.
On Sun, 20 Feb 2005 22:02:38 +0100, Julio M. Merino Vidal
Hi everybody,
I'm working on a program whose its actual syntax is:
vcsme [-c conf_file] [-q] action [action_args]
(very similar to the CVS one).
I'm trying to convert it to use boost::program_options (to get rid of the getopt(3) call, and to have long options), but I don't know how to do it.
I have a call: desc.add_options() ("help,h", "Blab to the users") That seems to allow --help and contractions, because of the "help, and -h, because of the ,h". It seemed to me that it's "<long option name>,<short option letter>"
So far, I've added the code to handle -c and -q options. This was very easy to do, given the examples on the web. The only annoyance is that the options are accepted everywhere, but I'd prefer to only accept them if they come before the action name (because the action itself might allow options).
I was looking for something similar. I defined:
struct my_parser {
my_parser() : found_subcmd(false) {};
std::pair
Unfortunately, I'm stuck with the latest part, the one to handle actions. There must always be an action passed to the program, which may optionally accept arguments. Some example invocations:
I'd guess that you'd create another variable map and run a different parser on the words in the vector sub-cmd. But bear in mind the first line. ;) ---- Blue skies