-
-
Couldn't load subscription status.
- Fork 63
Open
Description
Currently, the ARG_OPTIONAL_BOOL does not behave optimally (see #2 ).
It seems to be a good idea to have more macros for switch-on, switch-off and both (as the current ARG_OPTIONAL_BOOL somehow attempts to).
Currently, ARG_OPTIONAL_BOOL assumes that one wants to switch something on (using long and short option) and autogenerating long option to switch something off. This falls on its head when one wants to switch something off.
Proposed behavior:
ARG_OPTIONAL_BOOLwill remain, it will autodetect whether it is in a switch-on or switch-off mode by examining the default (or the option whether it begins withno-..., I'm not yet decided). It will use the provided long and short options for the detected mode, but it will also generate a long option for the opposite mode.- Occurence of
ARG_OPTIONAL_BOOL(no-video, v)would make the script accept--no-video,-v, that would set_arg_video(which would beonby default) tooff, and--video, that would set_arg_videotoon, overriding possible previous occurence of-vor--no-video. - Conversely, occurence of
ARG_OPTIONAL_BOOL(video, v)would make the script accept--video,-v, that would set_arg_video(which would beoffby default) toon, and--no-video, that would set_arg_videotooff, overriding possible previous occurence of-vor--video.
- Occurence of
New macros would be introduced:
ARG_OPTIONAL_SWITCH_ONwill be introduced. It will accept long and short option (and no default sinceoffwill be assumed as default).- Occurence of
ARG_OPTIONAL_SWITCH_ON(video, v)would make the script accept--video,-v, that would set_arg_video(which would beoffby default) toon.
- Occurence of
ARG_OPTIONAL_SWITCH_OFFwill be introduced. It will accept long and short option (and no default sinceonwill be assumed).- Occurence of
ARG_OPTIONAL_SWITCH_OFF(no-video, v)would make the script accept--no-video,-v, that would set_arg_video(which would beonby default) tooff.
Everybody's comments are highly appreciated!
- Occurence of
edannenberg, Gcaufy and jthurne