[program_options] detecting if "arguments" are passed
28 Jul
2009
28 Jul
'09
1:35 p.m.
I am using Boost.ProgramOptions to parse my command line options. By default, I an exception is thrown when an unknown option is passed. So far, so good. Suppose I have a program p that takes only the option --help - and nothing else, esp. not a "positional option" or "arguments". I.e. I would like to croak a message to the user if she call something like p /tmp/x ProgramOptions does croak when I call "p -v", but not when I call "p /tmp/x". Question: What is the recommended way to catch unwanted (or forbidden) arguments (not options!)? (I know I can define a positional like --input-file and then check if any of those are present. But that seems quite awkward for such a "simple" thing.) Best regards Christoph
5603
Age (days ago)
5603
Last active (days ago)
0 comments
1 participants
participants (1)
-
Christoph Duelli