Skip to content

Bash does not like '-' in function names #573

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

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

kennyyork
Copy link
Contributor

If a ParsableCommand has a commandName value with a hyphen, the bash completion generator will generate a function name with a hyphen which isn't valid in BASH, eg _programName_command_sub-command': not a valid identifier

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 so much for working on this, @kennyyork!

It looks like we're already escaping in this way for zsh, and it's probably safe to assume that fish has this same requirement. Could you rename the existing zshEscapingCommandName method to shellEscapingCommandName, and then have all three script generators use that?

@natecook1000 natecook1000 force-pushed the invalid-bash-completions branch from 4135438 to 5b921a0 Compare November 19, 2023 20:12
@natecook1000
Copy link
Member

@swift-ci Please test

@natecook1000 natecook1000 force-pushed the invalid-bash-completions branch from 5b921a0 to f57bea9 Compare November 19, 2023 20:34
@natecook1000 natecook1000 force-pushed the invalid-bash-completions branch from f57bea9 to fed6a9b Compare November 19, 2023 20:40
@natecook1000
Copy link
Member

@swift-ci Please test

@natecook1000 natecook1000 merged commit 9eded54 into apple:main Nov 20, 2023
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