MCPcopy
hub / github.com/cli/cli / MutuallyExclusive

Function MutuallyExclusive

pkg/cmdutil/errors.go:47–58  ·  view source on GitHub ↗
(message string, conditions ...bool)

Source from the content-addressed store, hash-verified

45}
46
47func MutuallyExclusive(message string, conditions ...bool) error {
48 numTrue := 0
49 for _, ok := range conditions {
50 if ok {
51 numTrue++
52 }
53 }
54 if numTrue > 1 {
55 return FlagErrorf("%s", message)
56 }
57 return nil
58}
59
60type NoResultsError struct {
61 message string

Callers 15

NewCmdDeleteFunction · 0.92
NewCmdViewFunction · 0.92
NewCmdCommentFunction · 0.92
NewCmdCreateFunction · 0.92
NewCmdEditFunction · 0.92
NewCmdCheckFunction · 0.92
NewCmdDownloadFunction · 0.92
checkArchiveTypeOptionFunction · 0.92
NewCmdCreateFunction · 0.92
NewCmdLinkFunction · 0.92
NewCmdEditItemFunction · 0.92
NewCmdUnlinkFunction · 0.92

Calls 1

FlagErrorfFunction · 0.85

Tested by

no test coverage detected