Skip to content

Add completion-cmds for shell completion and change brew committer#50

Merged
wfchandler merged 3 commits into
mainfrom
wc/change-brew-bot
Jul 4, 2025
Merged

Add completion-cmds for shell completion and change brew committer#50
wfchandler merged 3 commits into
mainfrom
wc/change-brew-bot

Conversation

@wfchandler

Copy link
Copy Markdown
Collaborator
  • Add completion-cmds for shell completion

    Add a new dist.completion-cmds option which takes a map of binary
    names to the subcommand to execute to generate shell completions.

    This hooks in very easily with the homebrew
    generate_completions_from_executable helper function, which will
    default to generating completions for bash, zsh, and fish.

  • Don't use axobot for homebrew commits

    We don't really want to be using an account we don't own to be listed as
    the committer on our homebrew tap.

    Given that we're using a PAT, set that user as the committer. This has
    the added benefit of making it easier to discover who to contact when
    the PAT expires.

We don't really want to be using an account we don't own to be listed as
the committer on our homebrew tap.

Given that we're using a PAT, set that user as the committer. This has
the added benefit of making it easier to discover who to contact when
the PAT expires.
@wfchandler
wfchandler force-pushed the wc/change-brew-bot branch 3 times, most recently from ce22dd9 to dfe7833 Compare July 4, 2025 17:17
Add a new `dist.completion-cmds` option which takes a map of binary
names to the subcommand to execute to generate shell completions.

This hooks in very easily with the Homebrew
`generate_completions_from_executable` helper function. We allow three
options for completion generation, `clap-env`, which will use
`clap_complete`'s environment variable option to trigger shell
completion, or `subcommand`, which specifies the subcommand and
parameter format, flag or arg, for the command. All options take an
array of shells.

  ```toml
  [dist.completion-cmds.mybin]
  trigger = "clap-env"
  shells = ["bash","fish"]

  [dist.completion-cmds.otherbin]
  trigger.subcommand = {{ name = "completions", format = "flag" }}
  shells = ["bash","fish","pwsh","zsh"]
  ```
@wfchandler
wfchandler force-pushed the wc/change-brew-bot branch from dfe7833 to e7e28e8 Compare July 4, 2025 17:47
@wfchandler
wfchandler merged commit 29cdf30 into main Jul 4, 2025
15 checks passed
@wfchandler
wfchandler deleted the wc/change-brew-bot branch July 4, 2025 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant