2

When I define a boolean switch for my program, say,

("foo,f", "frobnicate")

I want to be able to say

myprogram --foo
myprogram --no-foo
myprogram --foo=no

or at the very least, the first and one of the second or the third. Does program_options support this somehow? Or do I have to 'manually' define these switches?

einpoklum
  • 118,144
  • 57
  • 340
  • 684

1 Answers1

1

You have to define them yourself.

The library tells you what options have been given on the command line, and then it's up to you to map those options to features/flags/whatever. As such, it doesn't tell you whether features/flags/whatever are "on" or "off"; that's the remit of your handling code.

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055