make table explicitly default

pull/3652/head
Rajat Jindal 7 years ago
parent 46ed802750
commit c93ff32f52

@ -90,7 +90,7 @@ func newHistoryCmd(c helm.Interface, w io.Writer) *cobra.Command {
f := cmd.Flags() f := cmd.Flags()
f.Int32Var(&his.max, "max", 256, "maximum number of revision to include in history") 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.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 return cmd
} }
@ -114,8 +114,10 @@ func (cmd *historyCmd) run() error {
history, formattingError = yaml.Marshal(releaseHistory) history, formattingError = yaml.Marshal(releaseHistory)
case "json": case "json":
history, formattingError = json.Marshal(releaseHistory) history, formattingError = json.Marshal(releaseHistory)
default: case "table":
history = formatAsTable(releaseHistory, cmd.colWidth) history = formatAsTable(releaseHistory, cmd.colWidth)
default:
return fmt.Errorf("unknown output format %q", cmd.outputFormat)
} }
if formattingError != nil { if formattingError != nil {

@ -30,7 +30,7 @@ helm history [flags] RELEASE_NAME
``` ```
--col-width uint specifies the max column width of output (default 60) --col-width uint specifies the max column width of output (default 60)
--max int32 maximum number of revision to include in history (default 256) --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 enable TLS for request
--tls-ca-cert string path to TLS CA certificate file (default "$HELM_HOME/ca.pem") --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") --tls-cert string path to TLS certificate file (default "$HELM_HOME/cert.pem")
@ -52,4 +52,4 @@ helm history [flags] RELEASE_NAME
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [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

Loading…
Cancel
Save