Skip to content

Commit

Permalink
Merge pull request #7 from burl/feature/masked-input
Browse files Browse the repository at this point in the history
updated examples to include a username/password query.  bumped version
  • Loading branch information
burl authored Mar 25, 2018
2 parents 7e2896f + 4a56718 commit 6f694f2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions demo/grail.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func widgetTest() {
os.Exit(1)
}

fmt.Printf("\nHere are the answers:\n---------------------\n")
fmt.Printf("name : %s\n", name)
fmt.Printf("quest : %s\n", quest)
fmt.Printf("colors: red:%v, green:%v, blue:%v\n", red, green, blue)
Expand Down
15 changes: 15 additions & 0 deletions example_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package inquire_test

import (
"os"

"github.com/burl/inquire"
"github.com/burl/inquire/widget"
)
Expand Down Expand Up @@ -80,3 +82,16 @@ func Example_valid() {
}).
Exec()
}

func Example_login() {
// Example of asking for a password (no terminal echo)
user := os.Getenv("LOGNAME")
pass := ""

inquire.Query().
Input(&user, "Username", nil).
Input(&pass, "Password", func(w *widget.Input) {
w.MaskInput() // Or pass a custom mask char: w.MaskInput('*')
}).
Exec()
}
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package inquire

// Version is the API version of inquire
const Version = "0.0.2"
const Version = "0.0.3"

0 comments on commit 6f694f2

Please sign in to comment.