Skip to content

Commit

Permalink
InvokedAction: retain - use vararg for consistency with Action
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Jul 22, 2023
1 parent 1f72769 commit 1e2ebf3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion action.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (a Action) Prefix(prefix string) Action {
// carapace.ActionValues("A", "B", "C").Retain("A", "C") // ["A", "C"]
func (a Action) Retain(values ...string) Action {
return ActionCallback(func(c Context) Action {
return a.Invoke(c).Retain(values).ToA()
return a.Invoke(c).Retain(values...).ToA()
})
}

Expand Down
2 changes: 1 addition & 1 deletion invokedAction.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (a InvokedAction) Prefix(prefix string) InvokedAction {
//
// a := carapace.ActionValues("A", "B", "C").Invoke(c)
// b := a.Retain([]string{"A", "C"}) // ["A", "C"]
func (a InvokedAction) Retain(values []string) InvokedAction {
func (a InvokedAction) Retain(values ...string) InvokedAction {
a.rawValues = a.rawValues.Retain(values...)
return a
}
Expand Down

0 comments on commit 1e2ebf3

Please sign in to comment.