summaryrefslogtreecommitdiff
path: root/cmd/podman/export.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/export.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/export.go')
-rw-r--r--cmd/podman/export.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/podman/export.go b/cmd/podman/export.go
index e5dc410a7..92633facd 100644
--- a/cmd/podman/export.go
+++ b/cmd/podman/export.go
@@ -36,7 +36,7 @@ func init() {
exportCommand.SetHelpTemplate(HelpTemplate())
exportCommand.SetUsageTemplate(UsageTemplate())
flags := exportCommand.Flags()
- flags.StringVarP(&exportCommand.Output, "output", "o", "/dev/stdout", "Write to a file, default is STDOUT")
+ flags.StringVarP(&exportCommand.Output, "output", "o", "", "Write to a specified file (default: stdout, which must be redirected)")
}
// exportCmd saves a container to a tarball on disk
@@ -60,15 +60,16 @@ func exportCmd(c *cliconfig.ExportValues) error {
}
output := c.Output
- if runtime.Remote && (output == "/dev/stdout" || len(output) == 0) {
+ if runtime.Remote && len(output) == 0 {
return errors.New("remote client usage must specify an output file (-o)")
}
- if output == "/dev/stdout" {
+ if len(output) == 0 {
file := os.Stdout
if logrus.IsTerminal(file) {
return errors.Errorf("refusing to export to terminal. Use -o flag or redirect")
}
+ output = "/dev/stdout"
}
if err := parse.ValidateFileName(output); err != nil {