Skip to content

Commit 3bddbf0

Browse files
authored
Merge pull request #296 from lucassabreu/issue/295
fix: redundant zsh auto-completion commands
2 parents fd1bfdd + f448b1c commit 3bddbf0

2 files changed

Lines changed: 10 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- zsh auto-complete did not follow the right pattern for people the use auto-completion files
13+
14+
### Thanks
15+
16+
Thank you to [@HaleTom](https://github.com/HaleTom) for reporting the zsh problema at
17+
[#295](https://github.com/lucassabreu/clockify-cli/issues/295).
18+
1019
## [v0.63.0] - 2026-03-26
1120

1221
### Added

pkg/cmd/completion/completion.go

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package completion
22

33
import (
4-
"fmt"
5-
"io"
64
"strings"
75

86
"github.com/MakeNowJust/heredoc"
@@ -36,7 +34,7 @@ func NewCmdCompletion() *cobra.Command {
3634
case bash:
3735
return cmd.Root().GenBashCompletion(out)
3836
case zsh:
39-
return genZshCompletion(cmd, out)
37+
return cmd.Root().GenZshCompletion(out)
4038
case fish:
4139
return cmd.Root().GenFishCompletion(out, false)
4240
case powershell:
@@ -85,17 +83,3 @@ func NewCmdCompletion() *cobra.Command {
8583

8684
return cmd
8785
}
88-
89-
func genZshCompletion(cmd *cobra.Command, w io.Writer) error {
90-
if _, err := fmt.Fprintln(w,
91-
"autoload -U compinit; compinit"); err != nil {
92-
return err
93-
}
94-
95-
if err := cmd.Root().GenZshCompletion(w); err != nil {
96-
return err
97-
}
98-
99-
_, err := fmt.Fprintln(w, "compdef _clockify-cli clockify-cli")
100-
return err
101-
}

0 commit comments

Comments
 (0)