summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-04-18 05:23:43 -0700
committerGitHub <noreply@github.com>2019-04-18 05:23:43 -0700
commit5260d33f95c652053c7c17b18fa843915dc22322 (patch)
tree3971a17971bd4acc842de0b776843d34a8e1e7fc /cmd
parent8b027dee48c6ac738bd1a2ac2b0f0a3f60e82945 (diff)
parent6b3d4abb07bd15f6ca2c2f1dc007c325b9cc0dc4 (diff)
downloadpodman-5260d33f95c652053c7c17b18fa843915dc22322.tar.gz
podman-5260d33f95c652053c7c17b18fa843915dc22322.tar.bz2
podman-5260d33f95c652053c7c17b18fa843915dc22322.zip
Merge pull request #2952 from rhatdan/change
Fix podman command --change CMD
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/commit.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/podman/commit.go b/cmd/podman/commit.go
index 5963f8686..8d79c1e28 100644
--- a/cmd/podman/commit.go
+++ b/cmd/podman/commit.go
@@ -42,7 +42,7 @@ func init() {
commitCommand.SetHelpTemplate(HelpTemplate())
commitCommand.SetUsageTemplate(UsageTemplate())
flags := commitCommand.Flags()
- flags.StringSliceVarP(&commitCommand.Change, "change", "c", []string{}, fmt.Sprintf("Apply the following possible instructions to the created image (default []): %s", strings.Join(libpod.ChangeCmds, " | ")))
+ flags.StringArrayVarP(&commitCommand.Change, "change", "c", []string{}, fmt.Sprintf("Apply the following possible instructions to the created image (default []): %s", strings.Join(libpod.ChangeCmds, " | ")))
flags.StringVarP(&commitCommand.Format, "format", "f", "oci", "`Format` of the image manifest and metadata")
flags.StringVarP(&commitCommand.Message, "message", "m", "", "Set commit message for imported image")
flags.StringVarP(&commitCommand.Author, "author", "a", "", "Set the author for the image committed")
@@ -83,6 +83,9 @@ func commitCmd(c *cliconfig.CommitValues) error {
if c.Flag("change").Changed {
for _, change := range c.Change {
splitChange := strings.Split(strings.ToUpper(change), "=")
+ if len(splitChange) == 1 {
+ splitChange = strings.Split(strings.ToUpper(change), " ")
+ }
if !util.StringInSlice(splitChange[0], libpod.ChangeCmds) {
return errors.Errorf("invalid syntax for --change: %s", change)
}