summaryrefslogtreecommitdiff
path: root/cmd/podman/system
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/system')
-rw-r--r--cmd/podman/system/connection/list.go9
-rw-r--r--cmd/podman/system/version.go2
2 files changed, 5 insertions, 6 deletions
diff --git a/cmd/podman/system/connection/list.go b/cmd/podman/system/connection/list.go
index f1f7657ad..2710142a8 100644
--- a/cmd/podman/system/connection/list.go
+++ b/cmd/podman/system/connection/list.go
@@ -82,7 +82,7 @@ func list(cmd *cobra.Command, _ []string) error {
return rows[i].Name < rows[j].Name
})
- format := "{{.Name}}\t{{.URI}}\t{{.Identity}}\t{{.Default}}\n"
+ var format string
switch {
case report.IsJSON(cmd.Flag("format").Value.String()):
buf, err := registry.JSONLibrary().MarshalIndent(rows, "", " ")
@@ -90,11 +90,10 @@ func list(cmd *cobra.Command, _ []string) error {
fmt.Println(string(buf))
}
return err
+ case cmd.Flags().Changed("format"):
+ format = report.NormalizeFormat(cmd.Flag("format").Value.String())
default:
- if cmd.Flag("format").Changed {
- format = cmd.Flag("format").Value.String()
- format = report.NormalizeFormat(format)
- }
+ format = "{{.Name}}\t{{.URI}}\t{{.Identity}}\t{{.Default}}\n"
}
format = report.EnforceRange(format)
diff --git a/cmd/podman/system/version.go b/cmd/podman/system/version.go
index 3443978d6..87b806503 100644
--- a/cmd/podman/system/version.go
+++ b/cmd/podman/system/version.go
@@ -59,7 +59,7 @@ func version(cmd *cobra.Command, args []string) error {
}
defer w.Flush()
- if cmd.Flag("format").Changed {
+ if cmd.Flags().Changed("format") {
row := report.NormalizeFormat(versionFormat)
tmpl, err := report.NewTemplate("version 2.0.0").Parse(row)
if err != nil {