|
7 | 7 | "github.com/docker/cli/cli" |
8 | 8 | "github.com/docker/cli/cli/command" |
9 | 9 | "github.com/docker/cli/cli/command/formatter" |
| 10 | + flagsHelper "github.com/docker/cli/cli/flags" |
10 | 11 | "github.com/docker/cli/opts" |
11 | 12 | "github.com/docker/cli/templates" |
12 | 13 | "github.com/docker/docker/api/types" |
@@ -46,7 +47,7 @@ func NewPsCommand(dockerCli command.Cli) *cobra.Command { |
46 | 47 | flags.BoolVar(&options.noTrunc, "no-trunc", false, "Don't truncate output") |
47 | 48 | flags.BoolVarP(&options.nLatest, "latest", "l", false, "Show the latest created container (includes all states)") |
48 | 49 | flags.IntVarP(&options.last, "last", "n", -1, "Show n last created containers (includes all states)") |
49 | | - flags.StringVarP(&options.format, "format", "", "", "Pretty-print containers using a Go template") |
| 50 | + flags.StringVarP(&options.format, "format", "", "", flagsHelper.FormatHelp) |
50 | 51 | flags.VarP(&options.filter, "filter", "f", "Filter output based on conditions provided") |
51 | 52 |
|
52 | 53 | return cmd |
@@ -80,7 +81,6 @@ func buildContainerListOptions(opts *psOptions) (*types.ContainerListOptions, er |
80 | 81 | // Only requesting container size information when needed is an optimization, |
81 | 82 | // because calculating the size is a costly operation. |
82 | 83 | tmpl, err := templates.NewParse("", opts.format) |
83 | | - |
84 | 84 | if err != nil { |
85 | 85 | return nil, errors.Wrap(err, "failed to parse template") |
86 | 86 | } |
|
0 commit comments