Skip to content

Fixed custom completion not working in zsh when command name contains a dash #364

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

CraigSiemens
Copy link
Contributor

Related issues and PRs

Description

This adds onto the fix from #284 that added support for commands with dashes in the name.

When getting completions for an argument using CompletionKind.custom(...) an error occurs. #284 updated a variable but missed updating where that variable is used to also escape the command name.

This updates the usage of that variable to also escape the command name and updates the tests to check for it.

Example

If I have a command called cli-tools with an argument that has a CompletionKind.custom(...), typing cli-tools a then pressing tab will produce the following error.

cli-tools a_custom_completion:1: command not found: -tools_commandname
_custom_completion:1: command not found: -tools_commandname
  cli-tools a

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

@natecook1000
Copy link
Member

Thanks for this fix, @CraigSiemens!

@natecook1000
Copy link
Member

@swift-ci Please test

@CraigSiemens
Copy link
Contributor Author

@natecook1000 Is there's anything on my side that's holding this up from being merged? I'm just curious since this PR's been open for over a month.

@natecook1000
Copy link
Member

@swift-ci Please test

@natecook1000
Copy link
Member

@CraigSiemens Nothing on your end! Merging once green 👍🏻

@natecook1000 natecook1000 merged commit d7f6384 into apple:main Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants