Creating Lots of Flags
Flags, Lots of Flags
Creating Flag and Accessing it
Just like mentioned in last section, you may create lots of flags in a .With(cb) callback code block, which of them will belong to its parent command.
A sample app works like this,
Now run it with command line option ~~tree, which is a builtin option with cmdr.v2, to dump all commands hierarchy as following:
So the result would be like,

Remarks
We said, the environment variable with value FORCE_DEFAULT_ACTION=1 makes cmdr.v2 ignore your custom OnAction to invoke a builtin responsed callback function, which will display a debug list for the hit command and the hit flags of its.
This would be useful for debugging.
Extra Topics
How is this guide?
Edit on GitHub
Last updated on