func PromptUserForInput(prompt string, terragruntOptions *options.TerragruntOptions) (string, error) {
	if terragruntOptions.Logger.Prefix() != "" {
		prompt = fmt.Sprintf("%s %s", terragruntOptions.Logger.Prefix(), prompt)
	}
	terragruntOptions.Logger.Print(prompt)
	if terragruntOptions.NonInteractive {
		terragruntOptions.Logger.Println()
		terragruntOptions.Logger.Printf("The non-interactive flag is set to true, so assuming 'yes' for all prompts")
		return "yes", nil
	}
	reader := bufio.NewReader(os.Stdin)
	text, err := reader.ReadString('\n')
	if err != nil {
		return "", errors.WithStackTrace(err)
	}
	return strings.TrimSpace(text), nil
}
Prompt the user for text in the CLI. Returns the text entered by the user.
package shell
import (
	"bufio"
	"fmt"
	"github.com/gruntwork-io/terragrunt/errors"
	"github.com/gruntwork-io/terragrunt/options"
	"os"
	"strings"
)