kubeadm: print supported shell types in error message for 'kubeadm completion'

This commit is contained in:
SataQiu 2023-12-25 17:28:34 +08:00
parent b9e0714722
commit 41a508f538

View File

@ -122,7 +122,7 @@ func RunCompletion(out io.Writer, boilerPlate string, cmd *cobra.Command, args [
}
run, found := completionShells[args[0]]
if !found {
return errors.Errorf("unsupported shell type %q", args[0])
return errors.Errorf("unsupported shell type %q, the supported shell types are %v", args[0], GetSupportedShells())
}
if len(boilerPlate) == 0 {