Boost logo

Boost Users :

Subject: [Boost-users] positional arguments in boost::program_options
From: Evan Driscoll (driscoll_at_[hidden])
Date: 2012-06-13 18:12:17


Hi, I'm writing a program which will run other programs (think xargs)
and I have the following question.

If I am reading the docs right, I get positional arguments by doing
something like
   1) Make a "normal" argument --arg
   2) Tell it that positional arguments map to --arg

However, if I do this, that means that if someone runs
   my_wrapper target_program --arg a
then the --arg "disappears" because boost::po treats it as an actual
option and not a positional argument.

I can (mostly) get around this by naming all the fake positional
arguments something like --ZZZZarg and assuming no one will ever want to
pass that to another program, but it's a bit unsatisfactory
conceptually. Is there a better way?

Evan


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