clef: minor ui quirks

This commit is contained in:
Martin Holst Swende 2019-02-22 11:09:45 +01:00
parent 6045173044
commit 644bdb467b
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0
2 changed files with 2 additions and 1 deletions

View file

@ -218,8 +218,8 @@ type (
Info map[string]interface{} `json:"info"`
}
UserInputRequest struct {
Prompt string `json:"prompt"`
Title string `json:"title"`
Prompt string `json:"prompt"`
IsPassword bool `json:"isPassword"`
}
UserInputResponse struct {

View file

@ -90,6 +90,7 @@ func (ui *CommandlineUI) OnInputRequired(info UserInputRequest) (UserInputRespon
fmt.Printf("## %s\n\n%s\n", info.Title, info.Prompt)
if info.IsPassword {
fmt.Printf("> ")
text, err := terminal.ReadPassword(int(os.Stdin.Fd()))
if err != nil {
log.Error("Failed to read password", "err", err)