Skip to content

Commit

Permalink
Merge pull request #36 from rsteube/rename-macrovari
Browse files Browse the repository at this point in the history
renamed MacroVarI to MacroV
  • Loading branch information
rsteube authored May 6, 2022
2 parents a08bf7e + f157e55 commit 2371a4a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion macro.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand Down
4 changes: 2 additions & 2 deletions macro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2371a4a

Please sign in to comment.