summaryrefslogtreecommitdiff
path: root/cmd/podman/volumes/list.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/volumes/list.go')
-rw-r--r--cmd/podman/volumes/list.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/podman/volumes/list.go b/cmd/podman/volumes/list.go
index e04f452d4..0d764e988 100644
--- a/cmd/podman/volumes/list.go
+++ b/cmd/podman/volumes/list.go
@@ -62,6 +62,7 @@ func init() {
flags.StringVar(&cliOpts.Format, formatFlagName, "{{.Driver}}\t{{.Name}}\n", "Format volume output using Go template")
_ = lsCommand.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteJSONFormat)
+ flags.Bool("noheading", false, "Do not print headers")
flags.BoolVarP(&cliOpts.Quiet, "quiet", "q", false, "Print volume output in quiet mode")
}
@@ -94,6 +95,7 @@ func list(cmd *cobra.Command, args []string) error {
}
func outputTemplate(cmd *cobra.Command, responses []*entities.VolumeListReport) error {
+ noHeading, _ := cmd.Flags().GetBool("noheading")
headers := report.Headers(entities.VolumeListReport{}, map[string]string{
"Name": "VOLUME NAME",
})
@@ -111,7 +113,7 @@ func outputTemplate(cmd *cobra.Command, responses []*entities.VolumeListReport)
w := tabwriter.NewWriter(os.Stdout, 12, 2, 2, ' ', 0)
defer w.Flush()
- if !cliOpts.Quiet && !cmd.Flag("format").Changed {
+ if !(noHeading || cliOpts.Quiet || cmd.Flag("format").Changed) {
if err := tmpl.Execute(w, headers); err != nil {
return errors.Wrapf(err, "failed to write report column headers")
}