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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- zsh auto-complete did not follow the right pattern for people the use auto-completion files

### Thanks

Thank you to [@HaleTom](https://github.com/HaleTom) for reporting the zsh problema at
[#295](https://github.com/lucassabreu/clockify-cli/issues/295).

## [v0.63.0] - 2026-03-26

### Added
Expand Down
18 changes: 1 addition & 17 deletions pkg/cmd/completion/completion.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package completion

import (
"fmt"
"io"
"strings"

"github.com/MakeNowJust/heredoc"
Expand Down Expand Up @@ -36,7 +34,7 @@ func NewCmdCompletion() *cobra.Command {
case bash:
return cmd.Root().GenBashCompletion(out)
case zsh:
return genZshCompletion(cmd, out)
return cmd.Root().GenZshCompletion(out)
case fish:
return cmd.Root().GenFishCompletion(out, false)
case powershell:
Expand Down Expand Up @@ -85,17 +83,3 @@ func NewCmdCompletion() *cobra.Command {

return cmd
}

func genZshCompletion(cmd *cobra.Command, w io.Writer) error {
if _, err := fmt.Fprintln(w,
"autoload -U compinit; compinit"); err != nil {
return err
}

if err := cmd.Root().GenZshCompletion(w); err != nil {
return err
}

_, err := fmt.Fprintln(w, "compdef _clockify-cli clockify-cli")
return err
}
Loading