Merge pull request #6563 from VilledeMontreal/fix/historyOutputFlag

v3: fix(cmd) have history use global output flag
pull/6568/head
Taylor Thomas 5 years ago committed by GitHub
commit e247d30503
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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))
}

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

Loading…
Cancel
Save