Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/carapace/cmd/choice.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func init() {
for _, choice := range list {
vals = append(vals, choice.Name, choice.Format())
}
return carapace.ActionValuesDescribed(vals...)
return carapace.ActionValuesDescribed(vals...).FilterArgs()
}

return carapace.ActionMultiPartsN("@", 2, func(c carapace.Context) carapace.Action {
Expand Down
1 change: 1 addition & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [UserConfigDir](./setup/userConfigDir.md)
- [Groups](./groups.md)
- [Variants](./variants.md)
- [Choices](./choices.md)
- [Completers](./completers.md)
- [Style](./style.md)
- [Bridges](./bridges.md)
Expand Down
2 changes: 2 additions & 0 deletions docs/src/bridges.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
> deprecated - will be replaced by [choices](./choices.md)

# Bridges

With `${UserConfigDir}/carapace/bridges.yaml` generic bridges can be configured for commands.
Expand Down
24 changes: 24 additions & 0 deletions docs/src/choices.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
> unreleased

# Choices

The **default priority** of completers can be **overridden** with `carapace --choice {name}[/{variant}][@{group}]`.

![](./choices/choices.cast)

> Choices are stored as simple text files in your [config directory](http://localhost:3000/setup/userConfigDir.html).
> ```sh
> carapace
> └── choices
> ├── sed # sed@bsd
> └── tldr # tldr/tldr-python-client
> ```

## Bridges

[Bridges](https://github.com/carapace-sh/carapace-bridge) are a special form of choices as they can be added as **additional completers** otherwise unknown.

![](./choices/bridges.cast)

> With [CARAPACE_BRIDGES](http://localhost:3000/setup/environment.html#carapace_bridges) completers from `zsh`, `fish`, `bash`, and `inshellisense` can largely determined and act as implicit fallback.
> But frameworks like [cobra](http://localhost:3000/setup/environment.html#carapace_bridges) need to be set explicitly.
199 changes: 199 additions & 0 deletions docs/src/choices/bridges.cast

Large diffs are not rendered by default.

310 changes: 310 additions & 0 deletions docs/src/choices/choices.cast

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion docs/src/release_notes/v1.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ commands:

## Groups

Organized completers into [**groups**](../groups.md).
Organized completers into [groups](../groups.md).

- `android` termux completers
- `bridge` bridged completers
Expand All @@ -51,6 +51,14 @@ Organized completers into [**groups**](../groups.md).

![](./v1.x/variants.cast)

## Choices

The default priority of completers can be overridden with [choices](../choices.md).

![](./v1.x/choices.cast)

> This replaces `bridges.yaml` which now has no effect and can be removed.


[aws-cli]:https://github.com/aws/aws-cli
[carapace-aws]:https://github.com/carapace-sh/carapace-aws
310 changes: 310 additions & 0 deletions docs/src/release_notes/v1.x/choices.cast

Large diffs are not rendered by default.