From 11ad8149ad3bdedbaab99ea15fffb44799061056 Mon Sep 17 00:00:00 2001 From: yory8 <> Date: Tue, 17 Sep 2019 12:53:35 +0200 Subject: [PATCH] refac!(selector): rename "-" to "STDOUT", add short opt --- main.go | 4 ++-- selector.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index be2e329..815de64 100644 --- a/main.go +++ b/main.go @@ -23,11 +23,11 @@ var ( picker = app.Command("pick", "Pick an item from clipboard history") maxPicker = picker.Flag("max-items", "scrollview length").Default("15").Int() - pickTool = picker.Flag("tool", "Which selector to use: dmenu/rofi/-").Default("dmenu").String() + pickTool = picker.Flag("tool", "Which selector to use: dmenu/rofi/STDOUT").Short('t').Default("dmenu").String() clearer = app.Command("clear", "Remove item(s) from history") maxClearer = clearer.Flag("max-items", "scrollview length").Default("15").Int() - clearTool = clearer.Flag("tool", "Which selector to use: dmenu/rofi/-").Default("dmenu").String() + clearTool = clearer.Flag("tool", "Which selector to use: dmenu/rofi/STDOUT").Short('t').Default("dmenu").String() clearAll = clearer.Flag("all", "Remove all items").Short('a').Default("false").Bool() ) diff --git a/selector.go b/selector.go index 54d6d09..9f18f4f 100644 --- a/selector.go +++ b/selector.go @@ -15,7 +15,7 @@ func selector(data []string, max int, tool string) (string, error) { } // output to stdout and return - if tool == "-" { + if tool == "STDOUT" { escaped, _ := preprocessData(data, false) os.Stdout.WriteString(strings.Join(escaped, "\n")) return "", nil