-
Notifications
You must be signed in to change notification settings - Fork 344
Fix zsh dashes in command names #284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tackling this, @adellibovi! 👏 A couple notes below.
#compdef \(type._commandName) | ||
#compdef \(commandName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this part can change — IIUC the #compdef
tells Zsh what command the completions are for, so they need to match the executable.
local context state state_descr line | ||
_\(type._commandName)_commandname=$words[1] | ||
_\(commandName)_commandname=$words[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand it, this is the only part that needs to change, since dashes are allowed in the function names, just not as a variable name. Can you still reproduce the issue if you only change this part here? As an extra benefit, this smaller change wouldn't cause problems for people who declare both sub-command
and sub_command
subcommands (which is a bad idea, but it will surely happen eventually).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, this is the only required changes. I made the change and tried locally :) Thanks for catching it @natecook1000. PR updated!
f47a00f
to
2239419
Compare
@swift-ci Please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Hi, this PR fixes #277
Checklist