diff options
author | Jhon Honce <jhonce@redhat.com> | 2021-11-18 09:03:00 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2021-12-02 09:07:27 -0700 |
commit | 61792de36ea2ea98f6e3aef3821d1b15beebf9e0 (patch) | |
tree | f2e73122b2cdb0323e1d38792eef44a625b85d10 /cmd/podman/volumes | |
parent | fbcebcb46a2444ce078dee10d8d51555bee8f177 (diff) | |
download | podman-61792de36ea2ea98f6e3aef3821d1b15beebf9e0.tar.gz podman-61792de36ea2ea98f6e3aef3821d1b15beebf9e0.tar.bz2 podman-61792de36ea2ea98f6e3aef3821d1b15beebf9e0.zip |
Refactor podman image command output
Leverage new report.Formatter allowing better compatibility from
podman command output.
Follow on PR's will cover containers, etc.
See #10974
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'cmd/podman/volumes')
-rw-r--r-- | cmd/podman/volumes/list.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cmd/podman/volumes/list.go b/cmd/podman/volumes/list.go index 0243054af..c372527de 100644 --- a/cmd/podman/volumes/list.go +++ b/cmd/podman/volumes/list.go @@ -97,9 +97,14 @@ func outputTemplate(cmd *cobra.Command, responses []*entities.VolumeListReport) "Name": "VOLUME NAME", }) - row := report.NormalizeFormat(cliOpts.Format) - if cliOpts.Quiet { + var row string + switch { + case cliOpts.Quiet: row = "{{.Name}}\n" + case cmd.Flags().Changed("format"): + row = report.NormalizeFormat(cliOpts.Format) + default: + row = cmd.Flag("format").Value.String() } format := report.EnforceRange(row) |