How to define mutually exlusive flags #1358
Labels
area/flags-args
Changes to functionality around command line flags and args
kind/feature
A feature request for cobra; new or enhanced behavior
Say, I've got flag
-x/--enable-x
, and-X/--disable-x
which disable the effect of previous-x/--enable-x
option. Surely, it's easy to enable either one of them in the logic silently. But it'd be interesting to see any mutually exlusive definition which will directly exit when encounter both-x
and-X
flags, and warn user about this.I couldn't find any docs related in
cobra
andpflag
.The text was updated successfully, but these errors were encountered: