Closed integratebio closed 2 years ago
Argh is a C++ command line parsing library. You are showing Python code. I don’t really know if you are asking about argh.
Regardless, a flag’s boolean state indicates whether or not it was specified in the command line. It does not indicate any semantic meaning it has in your program. If “—enable” or “—disable” are boolean flags, then True means they were specified. You may then do what you need with that information.
I have a function with a boolean argument whose default is set at
True
. I set upargh
like this:So on the command line, I would like to disable the boolean argument (
test
) How do I do this? If I runThe default value (True) is taken.
If I run
I get this error:
error: unrecognized arguments: --test False
.I tried to use prefixes (--no- and --disable-).
That also did not work.