Skip to content

Commit

Permalink
Merge pull request #2204 from rsteube/rm-explicit-bridge
Browse files Browse the repository at this point in the history
remove explicit bridge
  • Loading branch information
rsteube authored Jan 29, 2024
2 parents e7b6869 + 6f0e3e0 commit 0df9f91
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 29 deletions.
2 changes: 0 additions & 2 deletions cmd/carapace/cmd/invoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,13 @@ var invokeCmd = &cobra.Command{

func oldInvoke(cmd *cobra.Command, args []string) {
if overlayPath, err := overlayPath(args[0]); err == nil && len(args) > 2 { // and arg[1] is a known shell
// TODO support bridges here
cmd := &cobra.Command{
DisableFlagParsing: true,
CompletionOptions: cobra.CompletionOptions{
DisableDefaultCmd: true,
},
}

// TODO handle args[0]=command/bridge
// TODO yuck
command := args[0]
shell := args[1]
Expand Down
1 change: 0 additions & 1 deletion cmd/carapace/cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ func mapCompleters(all bool) map[string]_completer {
}
}

// TODO configured order and so on
for _, b := range env.Bridges() {
switch b {
case "bash":
Expand Down
25 changes: 1 addition & 24 deletions cmd/carapace/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/rsteube/carapace-bin/pkg/actions"
spec "github.com/rsteube/carapace-spec"
"github.com/rsteube/carapace/pkg/ps"
"github.com/rsteube/carapace/pkg/style"
"github.com/rsteube/carapace/pkg/xdg"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -208,29 +207,7 @@ func init() {
cmd.Flags().AddFlagSet(rootCmd.Flags())
return carapace.ActionExecute(cmd)
}
return carapace.ActionMultiPartsN("/", 2, func(c carapace.Context) carapace.Action {
switch len(c.Parts) {
case 0:
return action.ActionCompleters(action.CompleterOpts{}.Default())
default:
return carapace.ActionStyledValues(
"bash", "#d35673",
"carapace", style.Default,
"carapace-bin", style.Default,
"clap", style.Default,
"click", style.Default,
"cobra", style.Default,
"complete", style.Default,
"fish", "#7ea8fc",
"inshellisense", style.Default,
"kingpin", style.Default,
"powershell", style.Default,
"urfavecli", style.Default,
"yargs", style.Default,
"zsh", "#efda53",
)
}
})
return action.ActionCompleters(action.CompleterOpts{}.Default())
}),
)

Expand Down
2 changes: 0 additions & 2 deletions docs/src/bridges.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Bridges

> feature under development
With `~/.config/carapace/bridges.yaml` generic bridges can be configured for commands.

```yaml
Expand Down

0 comments on commit 0df9f91

Please sign in to comment.