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:
Kubernetes Prow Robot
2020-05-30 00:27:53 -07:00
committed by GitHub
16 changed files with 78 additions and 18 deletions

View File

@@ -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()