Skip to content

Commit

Permalink
[complete][zsh] Fixing issue with compgen function not being found (#499
Browse files Browse the repository at this point in the history
)

Depending on your version of zsh, you may not have `autoload compinit` called in your `.zshrc` file, which results in the following error (tested on a macOS):

  complete:13: command not found: compdef

I found the solution here, which worked when tested:
https://stackoverflow.com/a/76476988/1848826
  • Loading branch information
hick209 authored Mar 22, 2024
1 parent ebd80fb commit 9a87ccf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
- Added `limit` parameter to `option().counted()` to limit the number of times the option can be used. You can either clamp the value to the limit, or throw an error if the limit is exceeded. ([#483](https://github.com/ajalt/clikt/issues/483))
- Added `Context.registerClosable` and `Context.callOnClose` to allow you to register cleanup actions that will be called when the command exits. ([#395](https://github.com/ajalt/clikt/issues/395))

### Fixed
- Make sure auto complete script works on zsh, fixing the error `complete:13: command not found: compdef` ([#499](https://github.com/ajalt/clikt/pull/499))

## 4.2.2
### Changed
- Options and arguments can now reference option groups in their `defaultLazy` and other finalization blocks. They can also freely reference each other, including though chains of references. ([#473](https://github.com/ajalt/clikt/issues/473))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ internal object BashCompletionGenerator {
if (zsh) {
append(
"""
|autoload bashcompinit
|autoload -Uz compinit
|compinit
|autoload -Uz bashcompinit
|bashcompinit
|
|
Expand Down

0 comments on commit 9a87ccf

Please sign in to comment.