mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #75931 from xichengliudui/Simplify-two-if
Simplify two if (remove redundant code)
This commit is contained in:
commit
dd96b15e5d
@ -117,10 +117,9 @@ func NewCmdCompletion(out io.Writer, boilerPlate string) *cobra.Command {
|
||||
|
||||
// RunCompletion checks given arguments and executes command
|
||||
func RunCompletion(out io.Writer, boilerPlate string, cmd *cobra.Command, args []string) error {
|
||||
if len(args) == 0 {
|
||||
if length := len(args); length == 0 {
|
||||
return errors.New("shell not specified")
|
||||
}
|
||||
if len(args) > 1 {
|
||||
} else if length > 1 {
|
||||
return errors.New("too many arguments. expected only the shell type")
|
||||
}
|
||||
run, found := completionShells[args[0]]
|
||||
|
Loading…
Reference in New Issue
Block a user