Skip to content

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

Merged
natecook1000 merged 1 commit into
apple:mainfrom
kennyyork:invalid-bash-completions
Nov 20, 2023
Merged

Bash does not like '-' in function names#573
natecook1000 merged 1 commit into
apple:mainfrom
kennyyork:invalid-bash-completions

Conversation

@kennyyork
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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