From 21363a6442022fc9c6fd05e70a363915f24f27a5 Mon Sep 17 00:00:00 2001 From: Kunal Kushwaha Date: Thu, 12 Sep 2019 17:40:48 +0900 Subject: syntax updated for podman import --change currently, podman import change do not support syntax like - KEY val - KEY ["val"] This adds support for both of these syntax along with KEY=val Signed-off-by: Kunal Kushwaha --- cmd/podman/import.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/podman/import.go b/cmd/podman/import.go index d49792f27..027fa7299 100644 --- a/cmd/podman/import.go +++ b/cmd/podman/import.go @@ -39,7 +39,7 @@ func init() { importCommand.SetHelpTemplate(HelpTemplate()) importCommand.SetUsageTemplate(UsageTemplate()) flags := importCommand.Flags() - flags.StringSliceVarP(&importCommand.Change, "change", "c", []string{}, "Apply the following possible instructions to the created image (default []): CMD | ENTRYPOINT | ENV | EXPOSE | LABEL | STOPSIGNAL | USER | VOLUME | WORKDIR") + flags.StringArrayVarP(&importCommand.Change, "change", "c", []string{}, "Apply the following possible instructions to the created image (default []): CMD | ENTRYPOINT | ENV | EXPOSE | LABEL | STOPSIGNAL | USER | VOLUME | WORKDIR") flags.StringVarP(&importCommand.Message, "message", "m", "", "Set commit message for imported image") flags.BoolVarP(&importCommand.Quiet, "quiet", "q", false, "Suppress output") @@ -56,7 +56,6 @@ func importCmd(c *cliconfig.ImportValues) error { source string reference string ) - args := c.InputArgs switch len(args) { case 0: @@ -81,7 +80,7 @@ func importCmd(c *cliconfig.ImportValues) error { if runtime.Remote { quiet = false } - iid, err := runtime.Import(getContext(), source, reference, c.StringSlice("change"), c.String("message"), quiet) + iid, err := runtime.Import(getContext(), source, reference, importCommand.Change, c.String("message"), quiet) if err == nil { fmt.Println(iid) } -- cgit v1.2.3-54-g00ecf