Skip to content

Commit b686f9d

Browse files
authored
Merge pull request #3110 from carapace-sh/update-bridge
updated carapace-bridge
2 parents 9cb6156 + 12db330 commit b686f9d

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

completers/common/gcloud_completer/cmd/root.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package cmd
22

33
import (
4+
"os/exec"
5+
46
"github.com/carapace-sh/carapace"
57
"github.com/carapace-sh/carapace-bridge/pkg/actions/bridge"
68
"github.com/spf13/cobra"
@@ -23,14 +25,10 @@ func init() {
2325

2426
carapace.Gen(rootCmd).PositionalAnyCompletion(
2527
carapace.ActionCallback(func(c carapace.Context) carapace.Action {
26-
// TODO patch user@instance and --flag=optarg as in gcloud completion script
27-
28-
if c.Value == "-" {
29-
c.Value = "--" // seems shorthand flags aren't completed anyway so expand to longhand first
28+
if _, err := exec.LookPath("carapace-gcloud"); err == nil {
29+
return bridge.ActionCarapace("carapace-gcloud")
3030
}
31-
c.Setenv("CLOUDSDK_COMPONENT_MANAGER_DISABLE_UPDATE_CHECK", "1")
32-
//lint:ignore SA1019 gcloud uses an old argcomplete version
33-
return bridge.ActionArgcompleteV1("gcloud").Invoke(c).ToA()
31+
return bridge.ActionGcloud("gcloud")
3432
}),
3533
)
3634
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.23.1
44

55
require (
66
github.com/carapace-sh/carapace v1.10.3
7-
github.com/carapace-sh/carapace-bridge v1.4.9
7+
github.com/carapace-sh/carapace-bridge v1.4.10
88
github.com/carapace-sh/carapace-selfupdate v0.0.10
99
github.com/carapace-sh/carapace-shlex v1.1.1
1010
github.com/carapace-sh/carapace-spec v1.4.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
github.com/carapace-sh/carapace v1.10.3 h1:4L4HpEEZb+I2mtvqKMYed64QR15Tf6+uGDn8BIflObY=
22
github.com/carapace-sh/carapace v1.10.3/go.mod h1:gdyqmVIQJFlcHn4D7BkgyjRU5LlluDXBaiRSdV6GY88=
3-
github.com/carapace-sh/carapace-bridge v1.4.9 h1:f9P1dLcapT7mdBoHMu+SGQrrYiJ7PYkhiz8ZMleote8=
4-
github.com/carapace-sh/carapace-bridge v1.4.9/go.mod h1:MUOnmTjYoALyl5kDYPrStnA4oDnTcrYc2SL359T4CEY=
3+
github.com/carapace-sh/carapace-bridge v1.4.10 h1:yxLrjxSw9FeedEUounjj+oh6ya/TbSXMsswrFsp0dTU=
4+
github.com/carapace-sh/carapace-bridge v1.4.10/go.mod h1:cRTSrcdvoaz68yZGd24YhCljaBSUMxCUjB/wTRPqsVI=
55
github.com/carapace-sh/carapace-pflag v1.0.0 h1:uJMhl+vwEM/Eb0UdxZUuv4jo4rUAyPijkRGP5gfCuCE=
66
github.com/carapace-sh/carapace-pflag v1.0.0/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
77
github.com/carapace-sh/carapace-selfupdate v0.0.10 h1:ZvutqGwVvSj6TmI/tLcort63JD6PaOG0ia6squwbTuo=

0 commit comments

Comments
 (0)