Skip to content

Commit

Permalink
Move password prompt to prompt.go
Browse files Browse the repository at this point in the history
  • Loading branch information
lox committed Sep 2, 2015
1 parent 3d2c5e8 commit 98b6f6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions add.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"github.com/99designs/aws-vault/keyring"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/bgentry/speakeasy"
)

type AddCommandInput struct {
Expand All @@ -17,7 +16,7 @@ func AddCommand(ui Ui, input AddCommandInput) {
ui.Error.Fatal(err)
}

secretKey, err := speakeasy.Ask("Enter Secret Access Key: ")
secretKey, err := promptPassword("Enter Secret Access Key: ")
if err != nil {
ui.Error.Fatal(err)
}
Expand Down
6 changes: 6 additions & 0 deletions prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"fmt"
"os"
"strings"

"github.com/bgentry/speakeasy"
)

func prompt(prompt string) (string, error) {
Expand All @@ -16,3 +18,7 @@ func prompt(prompt string) (string, error) {
}
return strings.TrimSpace(text), nil
}

func promptPassword(prompt string) (string, error) {
return speakeasy.Ask(prompt)
}

0 comments on commit 98b6f6e

Please sign in to comment.