From 63453f3f1a3c93b5c33b8b03dc49e8608fd1fd59 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 29 Sep 2014 12:46:58 -0700 Subject: [PATCH] command: apply and refresh ask for input --- command/apply.go | 8 ++++++++ command/refresh.go | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/command/apply.go b/command/apply.go index 33ff38c3ba..859d0515f3 100644 --- a/command/apply.go +++ b/command/apply.go @@ -76,6 +76,12 @@ func (c *ApplyCommand) Run(args []string) int { c.Ui.Error(err.Error()) 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) { return 1 } @@ -234,6 +240,8 @@ Options: modifying. Defaults to the "-state-out" path with ".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. -refresh=true Update state prior to checking for differences. This diff --git a/command/refresh.go b/command/refresh.go index b4a3315281..83b094db9e 100644 --- a/command/refresh.go +++ b/command/refresh.go @@ -92,6 +92,12 @@ func (c *RefreshCommand) Run(args []string) int { c.Ui.Error(err.Error()) 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) { return 1 } @@ -147,6 +153,8 @@ Options: modifying. Defaults to the "-state-out" path with ".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. -state=path Path to read and save state (unless state-out