From cc9d12b1fd0979dea420d65ae2b9e57a2d0b4253 Mon Sep 17 00:00:00 2001 From: rsteube Date: Sun, 9 Apr 2023 17:43:24 +0200 Subject: [PATCH] readded macro `os.PathExecutables` as `executables` moved/renamed `os.ActionPathExecutables` to `carapace.ActionExecutables` --- completers/asciinema_completer/cmd/rec.go | 2 +- completers/batdiff_completer/cmd/root.go | 2 +- completers/batgrep_completer/cmd/root.go | 2 +- completers/cargo-watch_completer/cmd/root.go | 4 ++-- completers/coredumpctl_completer/cmd/root.go | 2 +- completers/delta_completer/cmd/root.go | 2 +- completers/direnv_completer/cmd/exec.go | 2 +- completers/git_completer/cmd/difftool.go | 2 +- completers/git_completer/cmd/grep.go | 2 +- completers/git_completer/cmd/mergetool.go | 2 +- completers/gum_completer/cmd/spin.go | 2 +- completers/just_completer/cmd/root.go | 2 +- completers/killall_completer/cmd/root.go | 2 +- completers/volta_completer/cmd/which.go | 2 +- completers/watch_completer/cmd/root.go | 2 +- completers/watchexec_completer/cmd/root.go | 2 +- completers/whereis_completer/cmd/root.go | 2 +- completers/which_completer/cmd/root.go | 2 +- completers/xargs_completer/cmd/root.go | 2 +- go.mod | 4 ++-- go.sum | 7 ++++--- pkg/util/embed/embed.go | 2 +- 22 files changed, 27 insertions(+), 26 deletions(-) diff --git a/completers/asciinema_completer/cmd/rec.go b/completers/asciinema_completer/cmd/rec.go index 8027995ee7..6702552a51 100644 --- a/completers/asciinema_completer/cmd/rec.go +++ b/completers/asciinema_completer/cmd/rec.go @@ -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(","), }) diff --git a/completers/batdiff_completer/cmd/root.go b/completers/batdiff_completer/cmd/root.go index 3f3f1844b3..b2527b5d30 100644 --- a/completers/batdiff_completer/cmd/root.go +++ b/completers/batdiff_completer/cmd/root.go @@ -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), diff --git a/completers/batgrep_completer/cmd/root.go b/completers/batgrep_completer/cmd/root.go index a6c874dbfb..e39faeb89d 100644 --- a/completers/batgrep_completer/cmd/root.go +++ b/completers/batgrep_completer/cmd/root.go @@ -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), diff --git a/completers/cargo-watch_completer/cmd/root.go b/completers/cargo-watch_completer/cmd/root.go index 1b54df7c87..799f8a21ae 100644 --- a/completers/cargo-watch_completer/cmd/root.go +++ b/completers/cargo-watch_completer/cmd/root.go @@ -89,7 +89,7 @@ func init() { if len(c.Args) < 1 { return carapace.Batch( - carapace.ActionPathExecutables(), + carapace.ActionExecutables(), carapace.ActionFiles(), ).ToA() } @@ -111,7 +111,7 @@ func init() { carapace.Gen(rootCmd).DashCompletion( carapace.Batch( - carapace.ActionPathExecutables(), + carapace.ActionExecutables(), carapace.ActionFiles(), ).ToA(), ) diff --git a/completers/coredumpctl_completer/cmd/root.go b/completers/coredumpctl_completer/cmd/root.go index 1f7ae66e1a..f0541dbe29 100644 --- a/completers/coredumpctl_completer/cmd/root.go +++ b/completers/coredumpctl_completer/cmd/root.go @@ -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(), diff --git a/completers/delta_completer/cmd/root.go b/completers/delta_completer/cmd/root.go index 9af9249014..73f6c55ab3 100644 --- a/completers/delta_completer/cmd/root.go +++ b/completers/delta_completer/cmd/root.go @@ -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), diff --git a/completers/direnv_completer/cmd/exec.go b/completers/direnv_completer/cmd/exec.go index eb7b544f13..7127fc4d0b 100644 --- a/completers/direnv_completer/cmd/exec.go +++ b/completers/direnv_completer/cmd/exec.go @@ -21,7 +21,7 @@ func init() { carapace.Gen(execCmd).PositionalCompletion( carapace.ActionDirectories(), carapace.Batch( - carapace.ActionPathExecutables(), + carapace.ActionExecutables(), carapace.ActionFiles(), ).ToA(), ) diff --git a/completers/git_completer/cmd/difftool.go b/completers/git_completer/cmd/difftool.go index 6c92facf14..da92d7c5c9 100644 --- a/completers/git_completer/cmd/difftool.go +++ b/completers/git_completer/cmd/difftool.go @@ -30,7 +30,7 @@ func init() { carapace.Gen(difftoolCmd).FlagCompletion(carapace.ActionMap{ "tool": carapace.Batch( - carapace.ActionPathExecutables(), + carapace.ActionExecutables(), carapace.ActionFiles(), ).ToA(), }) diff --git a/completers/git_completer/cmd/grep.go b/completers/git_completer/cmd/grep.go index 088393f619..fc7aeeeb97 100644 --- a/completers/git_completer/cmd/grep.go +++ b/completers/git_completer/cmd/grep.go @@ -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(), }) diff --git a/completers/git_completer/cmd/mergetool.go b/completers/git_completer/cmd/mergetool.go index 2ad782549a..f84732f4af 100644 --- a/completers/git_completer/cmd/mergetool.go +++ b/completers/git_completer/cmd/mergetool.go @@ -28,7 +28,7 @@ func init() { carapace.Gen(mergetoolCmd).FlagCompletion(carapace.ActionMap{ "tool": carapace.Batch( - carapace.ActionPathExecutables(), + carapace.ActionExecutables(), carapace.ActionFiles(), ).ToA(), }) diff --git a/completers/gum_completer/cmd/spin.go b/completers/gum_completer/cmd/spin.go index b0c27716da..4eb75befcd 100644 --- a/completers/gum_completer/cmd/spin.go +++ b/completers/gum_completer/cmd/spin.go @@ -91,7 +91,7 @@ func init() { switch len(c.Args) { case 0: return carapace.Batch( - carapace.ActionPathExecutables(), + carapace.ActionExecutables(), carapace.ActionFiles(), ).ToA() default: diff --git a/completers/just_completer/cmd/root.go b/completers/just_completer/cmd/root.go index 22f12fa663..7c153e0265 100644 --- a/completers/just_completer/cmd/root.go +++ b/completers/just_completer/cmd/root.go @@ -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), diff --git a/completers/killall_completer/cmd/root.go b/completers/killall_completer/cmd/root.go index 68fadcba87..0007a73373 100644 --- a/completers/killall_completer/cmd/root.go +++ b/completers/killall_completer/cmd/root.go @@ -43,6 +43,6 @@ func init() { }) carapace.Gen(rootCmd).PositionalAnyCompletion( - carapace.ActionPathExecutables(), + carapace.ActionExecutables(), ) } diff --git a/completers/volta_completer/cmd/which.go b/completers/volta_completer/cmd/which.go index 71abf6028a..18d7ba5eb0 100644 --- a/completers/volta_completer/cmd/which.go +++ b/completers/volta_completer/cmd/which.go @@ -20,6 +20,6 @@ func init() { rootCmd.AddCommand(whichCmd) carapace.Gen(whichCmd).PositionalCompletion( - carapace.ActionPathExecutables(), + carapace.ActionExecutables(), ) } diff --git a/completers/watch_completer/cmd/root.go b/completers/watch_completer/cmd/root.go index fdc68d5c02..baa9dc9505 100644 --- a/completers/watch_completer/cmd/root.go +++ b/completers/watch_completer/cmd/root.go @@ -39,7 +39,7 @@ func init() { carapace.Gen(rootCmd).PositionalCompletion( carapace.Batch( - carapace.ActionPathExecutables(), + carapace.ActionExecutables(), carapace.ActionFiles(), ).ToA(), ) diff --git a/completers/watchexec_completer/cmd/root.go b/completers/watchexec_completer/cmd/root.go index 6bf41f3631..49da6eeea9 100644 --- a/completers/watchexec_completer/cmd/root.go +++ b/completers/watchexec_completer/cmd/root.go @@ -57,7 +57,7 @@ func init() { carapace.Gen(rootCmd).PositionalCompletion( carapace.Batch( - carapace.ActionPathExecutables(), + carapace.ActionExecutables(), carapace.ActionFiles(), ).ToA(), ) diff --git a/completers/whereis_completer/cmd/root.go b/completers/whereis_completer/cmd/root.go index 0c9700a13c..1ecfd8734b 100644 --- a/completers/whereis_completer/cmd/root.go +++ b/completers/whereis_completer/cmd/root.go @@ -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() }), ) } diff --git a/completers/which_completer/cmd/root.go b/completers/which_completer/cmd/root.go index 6b6c14f169..bbc83d74c2 100644 --- a/completers/which_completer/cmd/root.go +++ b/completers/which_completer/cmd/root.go @@ -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(), ) } diff --git a/completers/xargs_completer/cmd/root.go b/completers/xargs_completer/cmd/root.go index db527e0539..ddc2013d14 100644 --- a/completers/xargs_completer/cmd/root.go +++ b/completers/xargs_completer/cmd/root.go @@ -82,7 +82,7 @@ func xargsCmd() *cobra.Command { carapace.Gen(cmd).PositionalCompletion( carapace.Batch( - carapace.ActionPathExecutables(), + carapace.ActionExecutables(), carapace.ActionFiles(), ).ToA(), ) diff --git a/go.mod b/go.mod index 961cc60330..f8bbdd6e84 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 89f492da95..5d268c7854 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/pkg/util/embed/embed.go b/pkg/util/embed/embed.go index fb5356f31d..f174a0acea 100644 --- a/pkg/util/embed/embed.go +++ b/pkg/util/embed/embed.go @@ -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(), )