Skip to content

Mutually exclusive flags in Cobra  #341

@JyotikaGargg

Description

@JyotikaGargg

In order to have few flags to act in mutual exclusive manner , we need to implement this function in Cobra implementation .
Some of the flags which need to mutually exclusive :

  •     UseTrustedConnection   bool   `short:"E" xor:"uid, auth"
    
  • UserName string `short:"U" xor:"uid"
  • InputFile []string `short:"i" xor:"input1, input2" type:"existingFile"
  • InitialQuery string `short:"q" xor:"input1"
  • Query string `short:"Q" xor:"input2"
  • DisableCmdAndWarn bool `short:"X" xor:"syscmd"
  • AuthenticationMethod string `xor:"auth"
  • UseAad bool `short:"G" xor:"auth"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions