annotate required flags for bash_completions

some commands require that certain flags be set in order to function.
Annotate those flags so the bash completions will suggest to the user
that they be set.
This commit is contained in:
Eric Paris
2015-03-17 11:49:35 -04:00
parent d44e9b4880
commit 0620940d26
8 changed files with 23 additions and 0 deletions

View File

@@ -57,6 +57,7 @@ func NewCmdExposeService(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmd.Flags().String("generator", "service/v1", "The name of the API generator to use. Default is 'service/v1'.")
cmd.Flags().String("protocol", "TCP", "The network protocol for the service to be created. Default is 'tcp'.")
cmd.Flags().Int("port", -1, "The port that the service should serve on. Required.")
cmd.MarkFlagRequired("port")
cmd.Flags().Bool("create-external-load-balancer", false, "If true, create an external load balancer for this service. Implementation is cloud provider dependent. Default is 'false'.")
cmd.Flags().String("selector", "", "A label selector to use for this service. If empty (the default) infer the selector from the replication controller.")
cmd.Flags().StringP("labels", "l", "", "Labels to apply to the service created by this call.")