mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-04 18:13:42 +08:00 
			
		
		
		
	history: fix default format for inspect command
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
		@@ -471,7 +471,7 @@ workers0:
 | 
				
			|||||||
		enc := json.NewEncoder(dockerCli.Out())
 | 
							enc := json.NewEncoder(dockerCli.Out())
 | 
				
			||||||
		enc.SetIndent("", "  ")
 | 
							enc.SetIndent("", "  ")
 | 
				
			||||||
		return enc.Encode(out)
 | 
							return enc.Encode(out)
 | 
				
			||||||
	} else if opts.format != formatter.RawFormatKey {
 | 
						} else if opts.format != formatter.PrettyFormatKey {
 | 
				
			||||||
		tmpl, err := template.New("inspect").Parse(opts.format)
 | 
							tmpl, err := template.New("inspect").Parse(opts.format)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			return errors.Wrapf(err, "failed to parse format template")
 | 
								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 := cmd.Flags()
 | 
				
			||||||
	flags.StringVar(&options.format, "format", formatter.RawFormatKey, "Format the output")
 | 
						flags.StringVar(&options.format, "format", formatter.PrettyFormatKey, "Format the output")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return cmd
 | 
						return cmd
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,11 +12,11 @@ Inspect a build
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
### Options
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| Name                  | Type     | Default | Description                              |
 | 
					| Name                  | Type     | Default  | Description                              |
 | 
				
			||||||
|:----------------------|:---------|:--------|:-----------------------------------------|
 | 
					|:----------------------|:---------|:---------|:-----------------------------------------|
 | 
				
			||||||
| `--builder`           | `string` |         | Override the configured builder instance |
 | 
					| `--builder`           | `string` |          | Override the configured builder instance |
 | 
				
			||||||
| `-D`, `--debug`       | `bool`   |         | Enable debug logging                     |
 | 
					| `-D`, `--debug`       | `bool`   |          | Enable debug logging                     |
 | 
				
			||||||
| [`--format`](#format) | `string` | `raw`   | Format the output                        |
 | 
					| [`--format`](#format) | `string` | `pretty` | Format the output                        |
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<!---MARKER_GEN_END-->
 | 
					<!---MARKER_GEN_END-->
 | 
				
			||||||
@@ -25,7 +25,7 @@ Inspect a build
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
### <a name="format"></a> Format the output (--format)
 | 
					### <a name="format"></a> 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.
 | 
					`json` or using a Go template.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```console
 | 
					```console
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user