Skip to content

fix: emit valid zsh completions for nested groups - #73

Merged
hlship merged 1 commit into
mainfrom
hlship/260903-zsh-nested-completions
Sep 3, 2026
Merged

fix: emit valid zsh completions for nested groups#73
hlship merged 1 commit into
mainfrom
hlship/260903-zsh-nested-completions

Conversation

@hlship

@hlship hlship commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Nested group completions now use the next path segment instead of a multi-word command path, so generated zsh scripts parse (zsh -n).
  • #compdef binds the real tool name, and -V/--version is included when dispatch has :version.

Fixes #72

Test plan

  • clj -M:test -m cognitect.test-runner -n net.lewisship.cli-tools.completions-test
  • Generate completions for a tool with nested groups and run zsh -n on the file
  • Confirm compinit defines nested functions such as _tool_group and _tool_group_nested
  • Confirm -V/--version appears when the tool sets :version

Use the next path segment in group completions, bind #compdef to the tool name, and include --version when configured.
@hlship hlship self-assigned this Sep 3, 2026
@hlship hlship added the bug Something isn't working label Sep 3, 2026
@hlship hlship added this to the 1.0.3 milestone Sep 3, 2026
@hlship
hlship marked this pull request as ready for review September 3, 2026 18:58
@hlship
hlship merged commit 03e0b64 into main Sep 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zsh completions: nested groups emit multi-word names that fail to parse

1 participant