command: apply and refresh ask for input

This commit is contained in:
Mitchell Hashimoto 2014-09-29 12:46:58 -07:00
parent 980fce1d6c
commit 63453f3f1a
2 changed files with 16 additions and 0 deletions

View File

@ -76,6 +76,12 @@ func (c *ApplyCommand) Run(args []string) int {
c.Ui.Error(err.Error()) c.Ui.Error(err.Error())
return 1 return 1
} }
if c.Input() {
if err := ctx.Input(); err != nil {
c.Ui.Error(fmt.Sprintf("Error configuring: %s", err))
return 1
}
}
if !validateContext(ctx, c.Ui) { if !validateContext(ctx, c.Ui) {
return 1 return 1
} }
@ -234,6 +240,8 @@ Options:
modifying. Defaults to the "-state-out" path with modifying. Defaults to the "-state-out" path with
".backup" extension. Set to "-" to disable backup. ".backup" extension. Set to "-" to disable backup.
-input=true Ask for input for variables if not directly set.
-no-color If specified, output won't contain any color. -no-color If specified, output won't contain any color.
-refresh=true Update state prior to checking for differences. This -refresh=true Update state prior to checking for differences. This

View File

@ -92,6 +92,12 @@ func (c *RefreshCommand) Run(args []string) int {
c.Ui.Error(err.Error()) c.Ui.Error(err.Error())
return 1 return 1
} }
if c.Input() {
if err := ctx.Input(); err != nil {
c.Ui.Error(fmt.Sprintf("Error configuring: %s", err))
return 1
}
}
if !validateContext(ctx, c.Ui) { if !validateContext(ctx, c.Ui) {
return 1 return 1
} }
@ -147,6 +153,8 @@ Options:
modifying. Defaults to the "-state-out" path with modifying. Defaults to the "-state-out" path with
".backup" extension. Set to "-" to disable backup. ".backup" extension. Set to "-" to disable backup.
-input=true Ask for input for variables if not directly set.
-no-color If specified, output won't contain any color. -no-color If specified, output won't contain any color.
-state=path Path to read and save state (unless state-out -state=path Path to read and save state (unless state-out