Skip to content

fix: correct zsh _arguments syntax in shell completion generation#22720

Closed
Ninso112 wants to merge 1 commit into
NousResearch:mainfrom
Ninso112:main
Closed

fix: correct zsh _arguments syntax in shell completion generation#22720
Ninso112 wants to merge 1 commit into
NousResearch:mainfrom
Ninso112:main

Conversation

@Ninso112

@Ninso112 Ninso112 commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes invalid zsh _arguments syntax in the generated shell completion script that caused zsh to reject the script with invalid argument errors
  • Replaces mutual-exclusion groups like (-h --help) with (-) (no exclusion), which is correct since short/long forms are aliases of the same option

Why

The hardcoded exclusion groups in generate_zsh() contained spaces between short and long option forms (e.g. (-h --help)), which zsh's _arguments parser rejects. The fix uses (-) to indicate no mutual exclusion, following zsh's official completion syntax guidelines.

Closes #22686

The generated zsh completion script used invalid mutual-exclusion group
syntax like '(-h --help){-h,--help}' which caused zsh to reject the
script with 'invalid argument' errors.

Replace with '(-){-h,--help}' where (-) means no mutual exclusion,
which is correct since short and long forms are aliases of the same
option. This follows zsh's official _arguments syntax guidelines.

Fixes NousResearch#22686
@teknium1

teknium1 commented May 9, 2026

Copy link
Copy Markdown
Contributor

Closing in favor of #22802 (salvage of #22727). Your fix was byte-identical to the winner — credited in the salvage PR body. Thanks!

@teknium1 teknium1 closed this May 9, 2026
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists labels May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: zsh completion script has invalid _arguments syntax

3 participants