You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Greetings everyone.
I am trying to create an option, which can accept values from the specified range (check(CLI::IsMember({...})) to the rescue), but the catch is that after using option's name in CLI (let's call this option -opt) the value used to associate with it might be absent. In that case some default value from the range is used.
So in the CLI for program executable all the following examples should be valid:
./executable -opt value1 -other_option value2 ... // value for opt is specified.
./executable -opt -other_option value2 // value for opt is absent; some default value is used.
./executable -other_option value2 // opt isn't used directly; some default value is used.
As I understand, in CLI11 if the non-flag option name is used, then the value for the option MUST follow. If this is true, is there any way for me to program the behaviour I specified above?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Greetings everyone.
I am trying to create an option, which can accept values from the specified range (
check(CLI::IsMember({...}))
to the rescue), but the catch is that after using option's name in CLI (let's call this option-opt
) the value used to associate with it might be absent. In that case some default value from the range is used.So in the CLI for program
executable
all the following examples should be valid:As I understand, in CLI11 if the non-flag option name is used, then the value for the option MUST follow. If this is true, is there any way for me to program the behaviour I specified above?
Thank you very much in advance.
Beta Was this translation helpful? Give feedback.
All reactions