From cb86db7ff5be3a930d9645be9841ac19815e63bb Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Wed, 2 Oct 2019 21:55:13 -0400 Subject: [PATCH] fix(cmd) have history use global output flag Also, it seems that for helm v3, the description of flags all start with a lowercase, so this commit also does that for the output flag. Signed-off-by: Marc Khouzam --- cmd/helm/flags.go | 2 +- cmd/helm/history.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/helm/flags.go b/cmd/helm/flags.go index 042484a29..a0f48cc7e 100644 --- a/cmd/helm/flags.go +++ b/cmd/helm/flags.go @@ -53,5 +53,5 @@ func bindOutputFlag(cmd *cobra.Command, varRef *string) { // NOTE(taylor): A possible refactor here is that we can implement all the // validation for the OutputFormat type here so we don't have to do the // parsing and checking in the command - cmd.Flags().StringVarP(varRef, outputFlag, "o", string(action.Table), fmt.Sprintf("Prints the output in the specified format. Allowed values: %s, %s, %s", action.Table, action.JSON, action.YAML)) + cmd.Flags().StringVarP(varRef, outputFlag, "o", string(action.Table), fmt.Sprintf("prints the output in the specified format. Allowed values: %s, %s, %s", action.Table, action.JSON, action.YAML)) } diff --git a/cmd/helm/history.go b/cmd/helm/history.go index ce7ceda69..61193b643 100644 --- a/cmd/helm/history.go +++ b/cmd/helm/history.go @@ -73,8 +73,8 @@ func newHistoryCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { } f := cmd.Flags() - f.StringVarP(&client.OutputFormat, "output", "o", action.Table.String(), "prints the output in the specified format (json|table|yaml)") f.IntVar(&client.Max, "max", 256, "maximum number of revision to include in history") + bindOutputFlag(cmd, &client.OutputFormat) return cmd }