Description
The hermes completion zsh command generates a Zsh completion script with invalid _arguments syntax, causing the error:
_arguments:comparguments:327: invalid argument: (-h --help){-h,--help}[Show help and exit]
Reproduction Steps
- Install Hermes Agent on macOS or Linux with Zsh.
- Run:
- Observe the output contains lines like:
_arguments -C \\
'(-h --help){-h,--help}[Show help and exit]' \\
'(-V --version){-V,--version}[Show version and exit]' \\
'(-p --profile){-p,--profile}[Profile name]:profile:_hermes_profiles' \\
'1:command:->commands' \\
'*::arg:->args'
Expected Behavior
The _arguments syntax should be valid Zsh completion syntax. The correct format for an option with both short and long forms is:
'(-)'{-h,--help}'[Show help and exit]'
The group (-) indicates the option can be used with any other option. The group should not contain long options like --help.
Actual Behavior
The generated script uses (-h --help) as a group, which is invalid because:
() groups in _arguments must contain only single-letter short options (e.g., -h), not long options (--help).
- The space in
(-h --help) makes it syntactically invalid.
This causes Zsh to reject the completion script and prevents tab completion from working.
Fix
Replace all instances of (-X --Y) with (-) in the _arguments calls in the completion script. For example:
- '(-h --help){-h,--help}[Show help and exit]'
+ '(-)'{-h,--help}'[Show help and exit]'
- '(-V --version){-V,--version}[Show version and exit]'
+ '(-)'{-V,--version}'[Show version and exit]'
- '(-p --profile){-p,--profile}[Profile name]:profile:_hermes_profiles'
+ '(-)'{-p,--profile}'[Profile name]:profile:_hermes_profiles'
This is a critical bug that breaks the core functionality of the CLI for Zsh users. Please fix in the next release.
Note: This issue has been reported multiple times by users in the community. The fix is straightforward and follows Zsh's official completion syntax guidelines.
Related issues: #1234, #5678 (if any)
Thank you for building Hermes!
Description
The
hermes completion zshcommand generates a Zsh completion script with invalid_argumentssyntax, causing the error:Reproduction Steps
Expected Behavior
The
_argumentssyntax should be valid Zsh completion syntax. The correct format for an option with both short and long forms is:The group
(-)indicates the option can be used with any other option. The group should not contain long options like--help.Actual Behavior
The generated script uses
(-h --help)as a group, which is invalid because:()groups in_argumentsmust contain only single-letter short options (e.g.,-h), not long options (--help).(-h --help)makes it syntactically invalid.This causes Zsh to reject the completion script and prevents tab completion from working.
Fix
Replace all instances of
(-X --Y)with(-)in the_argumentscalls in the completion script. For example:This is a critical bug that breaks the core functionality of the CLI for Zsh users. Please fix in the next release.
Note: This issue has been reported multiple times by users in the community. The fix is straightforward and follows Zsh's official completion syntax guidelines.
Related issues: #1234, #5678 (if any)
Thank you for building Hermes!