From f157e553d05760fe43692a6c5138bf2ab07010a0 Mon Sep 17 00:00:00 2001 From: rsteube Date: Sat, 7 May 2022 01:36:50 +0200 Subject: [PATCH] renamed MacroVarI to MacroV --- macro.go | 2 +- macro_test.go | 4 ++-- spec.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/macro.go b/macro.go index 8d104ba..789277b 100644 --- a/macro.go +++ b/macro.go @@ -65,7 +65,7 @@ func MacroI[T any](f func(t T) carapace.Action) Macro { } } -func MacroVarI[T any](f func(s ...T) carapace.Action) Macro { +func MacroV[T any](f func(s ...T) carapace.Action) Macro { return Macro{ Func: func(s string) carapace.Action { if s == "" { diff --git a/macro_test.go b/macro_test.go index a5885c5..a395768 100644 --- a/macro_test.go +++ b/macro_test.go @@ -27,12 +27,12 @@ func TestSignature(t *testing.T) { t.Errorf("should be: %v", expected) } - signature = MacroVarI(func(a ...Arg) carapace.Action { return carapace.ActionValues() }).Signature() + signature = MacroV(func(a ...Arg) carapace.Action { return carapace.ActionValues() }).Signature() if expected := `[{name: "", option: false}]`; signature != expected { t.Errorf("should be: %v", expected) } - signature = MacroVarI(func(b ...bool) carapace.Action { return carapace.ActionValues() }).Signature() + signature = MacroV(func(b ...bool) carapace.Action { return carapace.ActionValues() }).Signature() if expected := `[false]`; signature != expected { t.Errorf("should be: %v", expected) } diff --git a/spec.go b/spec.go index 88c2d12..64e5249 100644 --- a/spec.go +++ b/spec.go @@ -95,7 +95,7 @@ func parseAction(cmd *cobra.Command, arr []string) carapace.Action { nospace = true return carapace.ActionValues() })) - addCoreMacro("files", MacroVarI(carapace.ActionFiles)) + addCoreMacro("files", MacroV(carapace.ActionFiles)) addCoreMacro("directories", MacroN(carapace.ActionDirectories)) addCoreMacro("message", MacroI(carapace.ActionMessage)) addCoreMacro("", MacroI(func(s string) carapace.Action {