mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-17 15:13:08 +00:00
Merge pull request #91349 from neolit123/1.19-fail-on-unrecognized-args
cmd/*: fail on unrecognized flags/arguments for component CLI
This commit is contained in:
@@ -117,6 +117,14 @@ cluster's shared state through which all other components interact.`,
|
||||
|
||||
return Run(completedOptions, genericapiserver.SetupSignalHandler())
|
||||
},
|
||||
Args: func(cmd *cobra.Command, args []string) error {
|
||||
for _, arg := range args {
|
||||
if len(arg) > 0 {
|
||||
return fmt.Errorf("%q does not take any arguments, got %q", cmd.CommandPath(), args)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
fs := cmd.Flags()
|
||||
|
Reference in New Issue
Block a user