summaryrefslogtreecommitdiff
path: root/cmd/podman/generate/systemd.go
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2020-10-08 15:37:44 -0700
committerJhon Honce <jhonce@redhat.com>2020-10-08 18:19:37 -0700
commitf128bff232a9d9ee14376af83e7f917d3c47ceb8 (patch)
tree309941d317368f01439450303542f1e6d102c798 /cmd/podman/generate/systemd.go
parent2587cba3899213356575f01cc0aa226c0209b8ae (diff)
downloadpodman-f128bff232a9d9ee14376af83e7f917d3c47ceb8.tar.gz
podman-f128bff232a9d9ee14376af83e7f917d3c47ceb8.tar.bz2
podman-f128bff232a9d9ee14376af83e7f917d3c47ceb8.zip
Restore --format table...
Following commands: * systemd generate * networks inspect * pod stats * Fixed test where format was quoted and then quoted again * Fixed bug where output never printed '--' on missed reads * pod ps Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'cmd/podman/generate/systemd.go')
-rw-r--r--cmd/podman/generate/systemd.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/podman/generate/systemd.go b/cmd/podman/generate/systemd.go
index f690836a4..02e826549 100644
--- a/cmd/podman/generate/systemd.go
+++ b/cmd/podman/generate/systemd.go
@@ -6,6 +6,7 @@ import (
"os"
"path/filepath"
+ "github.com/containers/podman/v2/cmd/podman/parse"
"github.com/containers/podman/v2/cmd/podman/registry"
"github.com/containers/podman/v2/cmd/podman/utils"
"github.com/containers/podman/v2/pkg/domain/entities"
@@ -97,10 +98,10 @@ func systemd(cmd *cobra.Command, args []string) error {
}
}
- switch format {
- case "json":
+ switch {
+ case parse.MatchesJSONFormat(format):
return printJSON(report.Units)
- case "":
+ case format == "":
return printDefault(report.Units)
default:
return errors.Errorf("unknown --format argument: %s", format)