summaryrefslogtreecommitdiff
path: root/cmd/podman/images/load.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/images/load.go')
-rw-r--r--cmd/podman/images/load.go25
1 files changed, 19 insertions, 6 deletions
diff --git a/cmd/podman/images/load.go b/cmd/podman/images/load.go
index f49f95002..a984ad81f 100644
--- a/cmd/podman/images/load.go
+++ b/cmd/podman/images/load.go
@@ -15,6 +15,7 @@ import (
"github.com/containers/libpod/pkg/util"
"github.com/pkg/errors"
"github.com/spf13/cobra"
+ "github.com/spf13/pflag"
"golang.org/x/crypto/ssh/terminal"
)
@@ -27,6 +28,14 @@ var (
RunE: load,
Args: cobra.MaximumNArgs(1),
}
+
+ imageLoadCommand = &cobra.Command{
+ Args: cobra.MinimumNArgs(1),
+ Use: loadCommand.Use,
+ Short: loadCommand.Short,
+ Long: loadCommand.Long,
+ RunE: loadCommand.RunE,
+ }
)
var (
@@ -38,15 +47,20 @@ func init() {
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: loadCommand,
})
+ loadFlags(loadCommand.Flags())
+ registry.Commands = append(registry.Commands, registry.CliCommand{
+ Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
+ Command: imageLoadCommand,
+ Parent: imageCmd,
+ })
+ loadFlags(imageLoadCommand.Flags())
+}
- flags := loadCommand.Flags()
+func loadFlags(flags *pflag.FlagSet) {
flags.StringVarP(&loadOpts.Input, "input", "i", "", "Read from specified archive file (default: stdin)")
flags.BoolVarP(&loadOpts.Quiet, "quiet", "q", false, "Suppress the output")
flags.StringVar(&loadOpts.SignaturePolicy, "signature-policy", "", "Pathname of signature policy file")
- if registry.IsRemote() {
- _ = flags.MarkHidden("signature-policy")
- }
-
+ _ = flags.MarkHidden("signature-policy")
}
func load(cmd *cobra.Command, args []string) error {
@@ -61,7 +75,6 @@ func load(cmd *cobra.Command, args []string) error {
loadOpts.Tag = "latest"
}
if r, ok := ref.(reference.Named); ok {
- fmt.Println(r.Name())
loadOpts.Name = r.Name()
}
}