From 464f9278d1501ebd1da1c4504f826603affb9829 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Mon, 10 Feb 2025 11:23:23 +0100 Subject: [PATCH] history: fix default format for inspect command Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- commands/history/inspect.go | 4 ++-- docs/reference/buildx_history_inspect.md | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/commands/history/inspect.go b/commands/history/inspect.go index e83298cd..0dbfe21e 100644 --- a/commands/history/inspect.go +++ b/commands/history/inspect.go @@ -471,7 +471,7 @@ workers0: enc := json.NewEncoder(dockerCli.Out()) enc.SetIndent("", " ") return enc.Encode(out) - } else if opts.format != formatter.RawFormatKey { + } else if opts.format != formatter.PrettyFormatKey { tmpl, err := template.New("inspect").Parse(opts.format) if err != nil { return errors.Wrapf(err, "failed to parse format template") @@ -672,7 +672,7 @@ func inspectCmd(dockerCli command.Cli, rootOpts RootOptions) *cobra.Command { ) flags := cmd.Flags() - flags.StringVar(&options.format, "format", formatter.RawFormatKey, "Format the output") + flags.StringVar(&options.format, "format", formatter.PrettyFormatKey, "Format the output") return cmd } diff --git a/docs/reference/buildx_history_inspect.md b/docs/reference/buildx_history_inspect.md index 4af49f09..bfad9661 100644 --- a/docs/reference/buildx_history_inspect.md +++ b/docs/reference/buildx_history_inspect.md @@ -12,11 +12,11 @@ Inspect a build ### Options -| Name | Type | Default | Description | -|:----------------------|:---------|:--------|:-----------------------------------------| -| `--builder` | `string` | | Override the configured builder instance | -| `-D`, `--debug` | `bool` | | Enable debug logging | -| [`--format`](#format) | `string` | `raw` | Format the output | +| Name | Type | Default | Description | +|:----------------------|:---------|:---------|:-----------------------------------------| +| `--builder` | `string` | | Override the configured builder instance | +| `-D`, `--debug` | `bool` | | Enable debug logging | +| [`--format`](#format) | `string` | `pretty` | Format the output | @@ -25,7 +25,7 @@ Inspect a build ### Format the output (--format) -The formatting options (`--format`) pretty-prints the output to `raw` (default), +The formatting options (`--format`) pretty-prints the output to `pretty` (default), `json` or using a Go template. ```console