adding message option to the import subcommand

Signed-off-by: Taylor Jones <monitorjbl@gmail.com>
This commit is contained in:
Taylor Jones
2015-08-25 02:55:04 +00:00
parent 82e2dec06d
commit 936b2c6afe
6 changed files with 70 additions and 6 deletions
+2
View File
@@ -23,6 +23,7 @@ func (cli *DockerCli) CmdImport(args ...string) error {
cmd := Cli.Subcmd("import", []string{"file|URL|- [REPOSITORY[:TAG]]"}, "Create an empty filesystem image and import the contents of the\ntarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then\noptionally tag it.", true)
flChanges := opts.NewListOpts(nil)
cmd.Var(&flChanges, []string{"c", "-change"}, "Apply Dockerfile instruction to the created image")
message := cmd.String([]string{"m", "-message"}, "", "Set commit message for imported image")
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
@@ -35,6 +36,7 @@ func (cli *DockerCli) CmdImport(args ...string) error {
v.Set("fromSrc", src)
v.Set("repo", repository)
v.Set("message", *message)
for _, change := range flChanges.GetAll() {
v.Add("changes", change)
}