summaryrefslogtreecommitdiff
path: root/cmd/podman/save.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-03-15 06:22:46 -0700
committerGitHub <noreply@github.com>2019-03-15 06:22:46 -0700
commitccf991f530dbe41d86b904ec900fda01ae3e1474 (patch)
treeb1ae19c5cebdefbcedd5532108e30680cc687aad /cmd/podman/save.go
parent37dcc0a305a1606de7c0f5521d11250a4318bb51 (diff)
parent1e124306dbd35a4cfdf3f585119a2c4441ec543d (diff)
downloadpodman-ccf991f530dbe41d86b904ec900fda01ae3e1474.tar.gz
podman-ccf991f530dbe41d86b904ec900fda01ae3e1474.tar.bz2
podman-ccf991f530dbe41d86b904ec900fda01ae3e1474.zip
Merge pull request #2633 from edsantiago/default_default
Usage messages: deduplicate '(default true)' et al
Diffstat (limited to 'cmd/podman/save.go')
-rw-r--r--cmd/podman/save.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/podman/save.go b/cmd/podman/save.go
index df016b069..c10679740 100644
--- a/cmd/podman/save.go
+++ b/cmd/podman/save.go
@@ -58,7 +58,7 @@ func init() {
flags := saveCommand.Flags()
flags.BoolVar(&saveCommand.Compress, "compress", false, "Compress tarball image layers when saving to a directory using the 'dir' transport. (default is same compression type as source)")
flags.StringVar(&saveCommand.Format, "format", v2s2Archive, "Save image to oci-archive, oci-dir (directory with oci manifest type), docker-archive, docker-dir (directory with v2s2 manifest type)")
- flags.StringVarP(&saveCommand.Output, "output", "o", "/dev/stdout", "Write to a file, default is STDOUT")
+ flags.StringVarP(&saveCommand.Output, "output", "o", "", "Write to a specified file (default: stdout, which must be redirected)")
flags.BoolVarP(&saveCommand.Quiet, "quiet", "q", false, "Suppress the output")
}
@@ -79,14 +79,14 @@ func saveCmd(c *cliconfig.SaveValues) error {
return errors.Errorf("--compress can only be set when --format is either 'oci-dir' or 'docker-dir'")
}
- output := c.Output
- if output == "/dev/stdout" {
+ if len(c.Output) == 0 {
fi := os.Stdout
if logrus.IsTerminal(fi) {
return errors.Errorf("refusing to save to terminal. Use -o flag or redirect")
}
+ c.Output = "/dev/stdout"
}
- if err := parse.ValidateFileName(output); err != nil {
+ if err := parse.ValidateFileName(c.Output); err != nil {
return err
}
return runtime.SaveImage(getContext(), c)