From 11ba6d992a574385eb368ad17130c97b9977c33a Mon Sep 17 00:00:00 2001 From: Dmitry Rubtsov Date: Sun, 11 Dec 2022 00:51:24 +0600 Subject: [PATCH] fixes --- pkg/prompt/prompt.go | 7 ++++--- pkg/prompt/templates.go | 4 ++-- readme.md | 14 +++++++------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/pkg/prompt/prompt.go b/pkg/prompt/prompt.go index 1ea1665..ed376e0 100644 --- a/pkg/prompt/prompt.go +++ b/pkg/prompt/prompt.go @@ -1,10 +1,11 @@ package prompt import ( + "strconv" + "github.com/dmirubtsov/mcli/pkg/shortcuts" "github.com/erikgeiser/promptkit/selection" "github.com/erikgeiser/promptkit/textinput" - "strconv" ) func InputPromptInt(label string) (string, error) { @@ -24,8 +25,8 @@ func InputPromptString(label string) (string, error) { func SelectionPrompt(ss shortcuts.Shortcuts, size int) (int, error) { sel := selection.New("", ss) - sel.Template = SelectionSelectTemplate - sel.ResultTemplate = SelectionResultTemplate + sel.Template = selectionSelectTemplate + sel.ResultTemplate = selectionResultTemplate sel.FilterPlaceholder = filterPlaceholderText sel.Filter = selectionFilter sel.SelectedChoiceStyle = selectedChoiceStyle diff --git a/pkg/prompt/templates.go b/pkg/prompt/templates.go index 5ce8058..650b2a0 100644 --- a/pkg/prompt/templates.go +++ b/pkg/prompt/templates.go @@ -1,6 +1,6 @@ package prompt -const SelectionSelectTemplate = ` +const selectionSelectTemplate = ` {{- if .Prompt -}} {{ Bold .Prompt }} {{ end -}} @@ -27,6 +27,6 @@ const SelectionSelectTemplate = ` {{- end }} {{- end}} ` -const SelectionResultTemplate = ` +const selectionResultTemplate = ` {{- print FinalSymbolStyle " " (Final .FinalChoice) "\n" -}} ` diff --git a/readme.md b/readme.md index c34c1f8..adc59eb 100644 --- a/readme.md +++ b/readme.md @@ -12,13 +12,6 @@ Simple shortcut menu for shell commands ## Installation -#### macOS - -```bash -brew tap mazzz1y/tap -brew install mcli -``` - #### Arch Linux ```bash @@ -29,6 +22,13 @@ paru -S mcli-bin Packages available on the [Releases](https://github.com/mazzz1y/mcli/releases) page +#### macOS + +```bash +brew tap mazzz1y/tap +brew install mcli +``` + ## Usage ```