Allow -create to be passed still for BC

This commit is contained in:
Seth Vargo 2015-02-04 13:34:16 -05:00
parent bfc4f4ff7d
commit cd0d326934
1 changed files with 8 additions and 0 deletions

View File

@ -34,12 +34,14 @@ type pushUploadFn func(
func (c *PushCommand) Run(args []string) int {
var token string
var message string
var create bool
f := flag.NewFlagSet("push", flag.ContinueOnError)
f.Usage = func() { c.Ui.Error(c.Help()) }
f.StringVar(&token, "token", "", "token")
f.StringVar(&message, "m", "", "message")
f.StringVar(&message, "message", "", "message")
f.BoolVar(&create, "create", false, "create (deprecated)")
if err := f.Parse(args); err != nil {
return 1
}
@ -50,6 +52,12 @@ func (c *PushCommand) Run(args []string) int {
return 1
}
// Print deprecations
if create {
c.Ui.Error(fmt.Sprintf("The '-create' option is now the default and is\n" +
"longer used. It will be removed in the next version."))
}
// Read the template
tpl, err := packer.ParseTemplateFile(args[0], nil)
if err != nil {