summaryrefslogtreecommitdiff
path: root/cmd/podman/load.go
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2019-03-14 08:47:15 -0600
committerEd Santiago <santiago@redhat.com>2019-03-14 12:15:45 -0600
commit1e124306dbd35a4cfdf3f585119a2c4441ec543d (patch)
tree64a55fc5a8f86b253b30941861c0cb9e160d0f50 /cmd/podman/load.go
parent8f82edbcb3f43e39e037327ad39f4e660e11f20e (diff)
downloadpodman-1e124306dbd35a4cfdf3f585119a2c4441ec543d.tar.gz
podman-1e124306dbd35a4cfdf3f585119a2c4441ec543d.tar.bz2
podman-1e124306dbd35a4cfdf3f585119a2c4441ec543d.zip
save-load-export: clear cli-parsing default
...in order to silence Cobra's usually-helpful "(default xxx)" message. Initialization is now done in code, by testing for empty string and setting that to /dev/std{in,out} as appropriate; make special note of load.go where there's mild duplication between a local variable and cliconfig. Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'cmd/podman/load.go')
-rw-r--r--cmd/podman/load.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd/podman/load.go b/cmd/podman/load.go
index aedbdd8ac..46add699e 100644
--- a/cmd/podman/load.go
+++ b/cmd/podman/load.go
@@ -34,7 +34,7 @@ func init() {
loadCommand.SetHelpTemplate(HelpTemplate())
loadCommand.SetUsageTemplate(UsageTemplate())
flags := loadCommand.Flags()
- flags.StringVarP(&loadCommand.Input, "input", "i", "/dev/stdin", "Read from archive file instead of from terminal")
+ flags.StringVarP(&loadCommand.Input, "input", "i", "", "Read from specified archive file (default: stdin)")
flags.BoolVarP(&loadCommand.Quiet, "quiet", "q", false, "Suppress the output")
flags.StringVar(&loadCommand.SignaturePolicy, "signature-policy", "", "Pathname of signature policy file (not usually used)")
@@ -64,7 +64,10 @@ func loadCmd(c *cliconfig.LoadValues) error {
if runtime.Remote && len(input) == 0 {
return errors.New("the remote client requires you to load via -i and a tarball")
}
- if input == "/dev/stdin" {
+ if len(input) == 0 {
+ input = "/dev/stdin"
+ c.Input = input
+
fi, err := os.Stdin.Stat()
if err != nil {
return err