SIGN IN SIGN UP
spf13 / cobra UNCLAIMED

A Commander for modern Go CLI interactions

0 0 142 Go

Add ability to mark flags as required or exclusive as a group (#1654)

This change adds two features for dealing with flags:
 - requiring flags be provided as a group (or not at all)
 - requiring flags be mutually exclusive of each other

By utilizing the flag annotations we can mark which flag groups
a flag is a part of and during the parsing process we track which
ones we have seen or not.

A flag may be a part of multiple groups. The list of flags and the
type of group (required together or exclusive) make it a unique group.

Signed-off-by: John Schnake <jschnake@vmware.com>
J
John Schnake committed
68b6b24f0c9926a779f7113d1040396a30fdedaf
Parent: bf6cb58
Committed by GitHub <noreply@github.com> on 4/17/2022, 9:04:57 PM