Add shell completion for new --subresource flag
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca> Kubernetes-commit: 33b03096f2fb283f00966350d460e6f4198d4df4
This commit is contained in:
parent
eda5ed45b3
commit
7ef2d069b5
|
|
@ -477,6 +477,9 @@ func AddLabelSelectorFlagVar(cmd *cobra.Command, p *string) {
|
|||
|
||||
func AddSubresourceFlags(cmd *cobra.Command, subresource *string, usage string, allowedSubresources ...string) {
|
||||
cmd.Flags().StringVar(subresource, "subresource", "", fmt.Sprintf("%s Must be one of %v. This flag is alpha and may change in the future.", usage, allowedSubresources))
|
||||
CheckErr(cmd.RegisterFlagCompletionFunc("subresource", func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) {
|
||||
return allowedSubresources, cobra.ShellCompDirectiveNoFileComp
|
||||
}))
|
||||
}
|
||||
|
||||
type ValidateOptions struct {
|
||||
|
|
|
|||
Loading…
Reference in New Issue