Skip to content

Commit

Permalink
Merge pull request #1647 from rsteube/fix-pathexecutables
Browse files Browse the repository at this point in the history
readded macro `os.PathExecutables` as `executables`
  • Loading branch information
rsteube authored Apr 9, 2023
2 parents cf2b19f + cc9d12b commit 8d7cd2d
Show file tree
Hide file tree
Showing 22 changed files with 27 additions and 26 deletions.
2 changes: 1 addition & 1 deletion completers/asciinema_completer/cmd/rec.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func init() {
carapace.Gen(recCmd).FlagCompletion(carapace.ActionMap{
"command": carapace.Batch(
carapace.ActionFiles(),
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
).ToA(),
"env": os.ActionEnvironmentVariables().UniqueList(","),
})
Expand Down
2 changes: 1 addition & 1 deletion completers/batdiff_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func init() {

carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{
"pager": carapace.Batch(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
carapace.ActionFiles(),
).ToA(),
"paging": carapace.ActionValues("always", "never").StyleF(style.ForKeyword),
Expand Down
2 changes: 1 addition & 1 deletion completers/batgrep_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func init() {

carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{
"pager": carapace.Batch(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
carapace.ActionFiles(),
).ToA(),
"paging": carapace.ActionValues("always", "never").StyleF(style.ForKeyword),
Expand Down
4 changes: 2 additions & 2 deletions completers/cargo-watch_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func init() {

if len(c.Args) < 1 {
return carapace.Batch(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
carapace.ActionFiles(),
).ToA()
}
Expand All @@ -111,7 +111,7 @@ func init() {

carapace.Gen(rootCmd).DashCompletion(
carapace.Batch(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
carapace.ActionFiles(),
).ToA(),
)
Expand Down
2 changes: 1 addition & 1 deletion completers/coredumpctl_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func init() {

carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{
"debugger": carapace.Batch(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
carapace.ActionFiles(),
).ToA(),
"directory": carapace.ActionDirectories(),
Expand Down
2 changes: 1 addition & 1 deletion completers/delta_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func init() {
carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{
"inspect-raw-lines": carapace.ActionValues("true", "false").StyleF(style.ForKeyword),
"pager": carapace.Batch(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
carapace.ActionFiles(),
).ToA(),
"paging": carapace.ActionValues("auto", "always", "never").StyleF(style.ForKeyword),
Expand Down
2 changes: 1 addition & 1 deletion completers/direnv_completer/cmd/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func init() {
carapace.Gen(execCmd).PositionalCompletion(
carapace.ActionDirectories(),
carapace.Batch(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
carapace.ActionFiles(),
).ToA(),
)
Expand Down
2 changes: 1 addition & 1 deletion completers/git_completer/cmd/difftool.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func init() {

carapace.Gen(difftoolCmd).FlagCompletion(carapace.ActionMap{
"tool": carapace.Batch(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
carapace.ActionFiles(),
).ToA(),
})
Expand Down
2 changes: 1 addition & 1 deletion completers/git_completer/cmd/grep.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func init() {
"color": git.ActionColorModes(),
"f": carapace.ActionFiles(),
"open-files-in-pager": carapace.Batch(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
carapace.ActionFiles(),
).ToA(),
})
Expand Down
2 changes: 1 addition & 1 deletion completers/git_completer/cmd/mergetool.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func init() {

carapace.Gen(mergetoolCmd).FlagCompletion(carapace.ActionMap{
"tool": carapace.Batch(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
carapace.ActionFiles(),
).ToA(),
})
Expand Down
2 changes: 1 addition & 1 deletion completers/gum_completer/cmd/spin.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func init() {
switch len(c.Args) {
case 0:
return carapace.Batch(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
carapace.ActionFiles(),
).ToA()
default:
Expand Down
2 changes: 1 addition & 1 deletion completers/just_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func init() {

carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{
"chooser": carapace.Batch(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
carapace.ActionFiles(),
).ToA(),
"color": carapace.ActionValues("auto", "always", "never").StyleF(style.ForKeyword),
Expand Down
2 changes: 1 addition & 1 deletion completers/killall_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ func init() {
})

carapace.Gen(rootCmd).PositionalAnyCompletion(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
)
}
2 changes: 1 addition & 1 deletion completers/volta_completer/cmd/which.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ func init() {
rootCmd.AddCommand(whichCmd)

carapace.Gen(whichCmd).PositionalCompletion(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
)
}
2 changes: 1 addition & 1 deletion completers/watch_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func init() {

carapace.Gen(rootCmd).PositionalCompletion(
carapace.Batch(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
carapace.ActionFiles(),
).ToA(),
)
Expand Down
2 changes: 1 addition & 1 deletion completers/watchexec_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func init() {

carapace.Gen(rootCmd).PositionalCompletion(
carapace.Batch(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
carapace.ActionFiles(),
).ToA(),
)
Expand Down
2 changes: 1 addition & 1 deletion completers/whereis_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func init() {
if !rootCmd.Flag("f").Changed && (rootCmd.Flag("B").Changed || rootCmd.Flag("M").Changed || rootCmd.Flag("S").Changed) {
return carapace.ActionDirectories()
}
return carapace.ActionPathExecutables()
return carapace.ActionExecutables()
}),
)
}
2 changes: 1 addition & 1 deletion completers/which_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ func init() {
rootCmd.Flags().BoolP("version,", "v", false, "Print version and exit successfully.")

carapace.Gen(rootCmd).PositionalAnyCompletion(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
)
}
2 changes: 1 addition & 1 deletion completers/xargs_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func xargsCmd() *cobra.Command {

carapace.Gen(cmd).PositionalCompletion(
carapace.Batch(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
carapace.ActionFiles(),
).ToA(),
)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ go 1.19
require (
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/pelletier/go-toml v1.9.5
github.com/rsteube/carapace v0.34.0
github.com/rsteube/carapace v0.35.0
github.com/rsteube/carapace-bridge v0.0.21
github.com/rsteube/carapace-spec v0.6.5
github.com/rsteube/carapace-spec v0.6.6
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
golang.org/x/mod v0.10.0
Expand Down
7 changes: 4 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3v
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rsteube/carapace v0.34.0 h1:rYxGe+PIRYS1VTtHa/Z+61FxRD/5BHROCXpvW4lUVO8=
github.com/rsteube/carapace v0.34.0/go.mod h1:iIKzq9/zstfWPo9Z4EDNN1RPmhTKldV9of1zlSGgYXI=
github.com/rsteube/carapace v0.35.0 h1:cIt2gP2Jc9d7MprO1rtgSheb9peoLjPSPvdC7jLyf/U=
github.com/rsteube/carapace v0.35.0/go.mod h1:iIKzq9/zstfWPo9Z4EDNN1RPmhTKldV9of1zlSGgYXI=
github.com/rsteube/carapace-bridge v0.0.21 h1:IRVsncqqTvAn+93Qvcfx4K+1iLLdsfYSWwaMOjWDiAU=
github.com/rsteube/carapace-bridge v0.0.21/go.mod h1:Upp+Tj1qjl6SMAGePFk/o/1fnythg1saYJ5uTmq672c=
github.com/rsteube/carapace-pflag v0.1.0 h1:CPJRlj3jbyOnxuMf5pdrM76hEwdQ0STDDmkAHQcGbhg=
github.com/rsteube/carapace-pflag v0.1.0/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/rsteube/carapace-spec v0.6.5 h1:9u7ZExxPDU7MGTYHncN5ugJWOlVTUmaf4uIjrdGmjwU=
github.com/rsteube/carapace-spec v0.6.5/go.mod h1:sS1TfG0ekjnhWhFfSAA8fSRm56e+qxStRJYV/3uOHuc=
github.com/rsteube/carapace-spec v0.6.6 h1:pFYJ3oIHl91zlha0xCuownDCT4K1hcUfWgibS9y/710=
github.com/rsteube/carapace-spec v0.6.6/go.mod h1:SRD5RZ+YUZm0LNApdCa4KtbOJ009QMuhZ7kmjWGg6PI=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/embed/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (s *stringValue) String() string { return string(*s) }
func EmbedCarapaceBin(cmd *cobra.Command) {
carapace.Gen(cmd).PositionalCompletion(
carapace.Batch(
carapace.ActionPathExecutables(),
carapace.ActionExecutables(),
carapace.ActionFiles(),
).ToA(),
)
Expand Down

0 comments on commit 8d7cd2d

Please sign in to comment.