|
|
@ -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 {
|
|
|
|