Flag: Leading Plus Sign `+`
The leading plus sign can be recognized
+ShortFlag
Flag
While an end user typing +Flag
from command-line, cmdr
treats it as a variation of -ShortFlag
and --LongFlag
.
Suppose here is a flag defined as:
Now both -w +w --warning
are available inputs.
Once +w
is been parsing, the state will be stored and its (*Flag).LeadingPlusSign() bool
returns true
.
So you can extract the state from the OnAction
responed handler and extent it with your business logical.
Run
The possible result could be:
Usages
LeadingPlusSign
can be recognized by cmdr
and recorded, but no furture action will be launched.
Its intent depends on how you interpret it.
额外的话题
How is this guide?
Edit on GitHub
Last updated on