add support to actually specify prompt

This commit is contained in:
Ivar Fatland
2026-05-12 17:48:49 +02:00
parent 1d38507fb7
commit 2758ff5445
18 changed files with 2701 additions and 1 deletions
+7 -1
View File
@@ -9,10 +9,15 @@ import (
"strings"
"github.com/roodletoof/dotfiles/raymenu/picker"
"github.com/alexflint/go-arg"
)
func main() {
var args struct {
Prompt string `arg:"-p" help:"prompt"`
}
arg.MustParse(&args)
input, err := io.ReadAll(os.Stdin)
if err != nil {
log.Fatalln(err)
@@ -23,6 +28,7 @@ func main() {
})
choice, ok := picker.Picker(
choices,
picker.WithPrompt(args.Prompt),
)
if ok {
fmt.Println(choices[choice])