diff --git a/cmd/helm/history.go b/cmd/helm/history.go index 944d61509..573459f91 100644 --- a/cmd/helm/history.go +++ b/cmd/helm/history.go @@ -90,7 +90,7 @@ func newHistoryCmd(c helm.Interface, w io.Writer) *cobra.Command { f := cmd.Flags() f.Int32Var(&his.max, "max", 256, "maximum number of revision to include in history") f.UintVar(&his.colWidth, "col-width", 60, "specifies the max column width of output") - f.StringVarP(&his.outputFormat, "output", "o", "", "prints the output in the specified format ('json' or 'yaml' or defaults to 'table')") + f.StringVarP(&his.outputFormat, "output", "o", "table", "prints the output in the specified format ('json' or 'yaml' or defaults to 'table')") return cmd } @@ -114,8 +114,10 @@ func (cmd *historyCmd) run() error { history, formattingError = yaml.Marshal(releaseHistory) case "json": history, formattingError = json.Marshal(releaseHistory) - default: + case "table": history = formatAsTable(releaseHistory, cmd.colWidth) + default: + return fmt.Errorf("unknown output format %q", cmd.outputFormat) } if formattingError != nil { diff --git a/docs/helm/helm_history.md b/docs/helm/helm_history.md index 422c5f4e1..a4ef50b80 100755 --- a/docs/helm/helm_history.md +++ b/docs/helm/helm_history.md @@ -30,7 +30,7 @@ helm history [flags] RELEASE_NAME ``` --col-width uint specifies the max column width of output (default 60) --max int32 maximum number of revision to include in history (default 256) - -o, --output string prints the output in the specified format ('json' or 'yaml' or defaults to 'table') + -o, --output string prints the output in the specified format ('json' or 'yaml' or defaults to 'table') (default "table") --tls enable TLS for request --tls-ca-cert string path to TLS CA certificate file (default "$HELM_HOME/ca.pem") --tls-cert string path to TLS certificate file (default "$HELM_HOME/cert.pem") @@ -52,4 +52,4 @@ helm history [flags] RELEASE_NAME ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 9-Mar-2018 +###### Auto generated by spf13/cobra on 12-Mar-2018