Skip to content

Commit

Permalink
updated carapace to 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Mar 3, 2021
1 parent f60cf61 commit 644586b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 155 deletions.
4 changes: 2 additions & 2 deletions cmd/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Scripts can be directly sourced (though using pre-generated versions is recommen
ValidArgs: []string{"bash", "elvish", "fish", "powershell", "xonsh", "zsh"},
Run: func(cmd *cobra.Command, args []string) {
if len(args) > 0 {
fmt.Println(carapace.Gen(cmd).Snippet(args[0], true))
fmt.Println(carapace.Gen(cmd).Snippet(args[0]))
} else {
fmt.Println(carapace.Gen(cmd).Snippet("", true))
fmt.Println(carapace.Gen(cmd).Snippet(""))
}
},
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/mr_checkout.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ func init() {
checkoutCmd.Flags().BoolVar(&useHTTP, "http", false, "checkout using HTTP protocol instead of SSH")
mrCmd.AddCommand(checkoutCmd)
carapace.Gen(checkoutCmd).PositionalCompletion(
carapace.ActionCallback(func(args []string) carapace.Action {
return action.MergeRequests(mrList).Invoke([]string{"origin"}).ToA()
carapace.ActionCallback(func(c carapace.Context) carapace.Action {
c.Args = []string{"origin"}
return action.MergeRequests(mrList).Invoke(c).ToA()
}),
)
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
github.com/pelletier/go-toml v1.8.1 // indirect
github.com/pkg/errors v0.9.1
github.com/rivo/tview v0.0.0-20210125085121-dbc1f32bb1d0
github.com/rsteube/carapace v0.1.6
github.com/rsteube/carapace v0.4.1
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spf13/afero v1.4.1
github.com/spf13/cast v1.3.1 // indirect
Expand Down
Loading

0 comments on commit 644586b

Please sign in to comment.