diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2017-05-04 22:36:53 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2017-05-04 22:36:53 +0200 |
| commit | ec4270c43f1ddd37d1eb19da5db78129b93f72b7 (patch) | |
| tree | 67ab3eab1e71ef1b5479f3f5a00e040b622d7191 /main.go | |
| parent | c69e9f604c47469429a6a8a27ba7ef873134e0a1 (diff) | |
| download | gofu-ec4270c43f1ddd37d1eb19da5db78129b93f72b7.tar.gz | |
add "cli" package with a Query method
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -23,6 +23,7 @@ import ( "os" "path/filepath" + "github.com/majewsky/gofu/pkg/cli" "github.com/majewsky/gofu/pkg/rtree" ) @@ -44,5 +45,12 @@ func execApplet(applet string, args []string, allowGofu bool) { switch applet { case "rtree": rtree.Exec(args) + case "test": + choice, _ := cli.Query("Which is the best editor?", + cli.Choice{Shortcut: 'v', Text: "vim"}, + cli.Choice{Shortcut: 'e', Text: "emacs"}, + cli.Choice{Text: "atom"}, + ) + fmt.Printf("You selected %s. Good choice!\n", choice.Text) } } |
