aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2017-05-04 22:36:53 +0200
committerStefan Majewsky <majewsky@gmx.net>2017-05-04 22:36:53 +0200
commitec4270c43f1ddd37d1eb19da5db78129b93f72b7 (patch)
tree67ab3eab1e71ef1b5479f3f5a00e040b622d7191 /main.go
parentc69e9f604c47469429a6a8a27ba7ef873134e0a1 (diff)
downloadgofu-ec4270c43f1ddd37d1eb19da5db78129b93f72b7.tar.gz
add "cli" package with a Query method
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.go b/main.go
index 72768ea..3633b0e 100644
--- a/main.go
+++ b/main.go
@@ -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)
}
}