Skip to content

fix: correct zsh completion _arguments exclusion syntax#22728

Closed
AnnasMazhar wants to merge 1 commit into
NousResearch:mainfrom
AnnasMazhar:fix/zsh-completion-arguments-syntax
Closed

fix: correct zsh completion _arguments exclusion syntax#22728
AnnasMazhar wants to merge 1 commit into
NousResearch:mainfrom
AnnasMazhar:fix/zsh-completion-arguments-syntax

Conversation

@AnnasMazhar

Copy link
Copy Markdown

Description

Fixes #22686

The generated hermes completion zsh script used invalid _arguments syntax:

'(-h --help){-h,--help}[Show help and exit]'

zsh only accepts single-letter options (or -) inside the () mutual exclusion group — long options like --help cause a parse error.

Fix

  • Removed long options from () exclusion specs
  • Using (-) for help/version (no mutual exclusion needed)
  • Using (-p) for --profile (-p is a single char, valid)
  • Kept brace groups {-h,--help} for option aliases

Testing

  • Regenerated completion output with live parser
  • Verified with zsh -n — zero errors

Changed file: hermes_cli/completion.py

The generated zsh completion script used invalid _arguments syntax:
  '(-h --help){-h,--help}[Show help and exit]'

zsh only accepts single-letter options (or '-') inside the () mutual
exclusion group — long options like --help cause a parse error.

Fixed by:
- Removing long options from () exclusion specs
- Using (-) for help/version (no mutual exclusion needed)
- Using (-p) for --profile (single-char -p is valid)
- Keeping brace groups {-h,--help} for option aliases

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 technically valid but mixed (-p) with (-) instead of using (-) consistently for all options. 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

4 participants