Skip to content

Conversation

rgoldberg
Copy link
Contributor

@rgoldberg rgoldberg commented May 12, 2025

Improve flag & option name quoting in completion generation for all 3 shells.

Improve zsh quoting.

Many quoting issues remain.

To fix them, there should first be enforced & documented limits on the acceptable characters in various values throughout SAP to avoid unnecessary quoting (see #768).

Otherwise, there's a massive rabbit hole of quoting issues. Given the way that tests are currently setup, adding tests for a fixed issue in one shell requires the same issue to be fixed in all 3 shells, which is cumbersome.

e.g., I haven't ensured that fish's argparse function will work with shell characters that this PR now quotes. Beforehand, they would just break the whole script by causing syntax errors. Now, they might just mess up an option spec for argparse, which, while it could mess up argument parsing, will not cause syntax errors.

It will be a process of iterative improvement, rather than fixing everything at once.

Resolve #761

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

@rgoldberg rgoldberg force-pushed the 761-zsh-completion-argument-specs branch 2 times, most recently from 578f2a7 to 716f132 Compare May 18, 2025 23:01
… shells.

Improve zsh quoting.

Many quoting issues remain.

To fix them, there should first be enforced & documented limits on the acceptable characters in various values throughout SAP to avoid unnecessary quoting.

Signed-off-by: Ross Goldberg <[email protected]>
@rgoldberg rgoldberg force-pushed the 761-zsh-completion-argument-specs branch from 716f132 to 10706a6 Compare May 19, 2025 10:16
@natecook1000
Copy link
Member

@swift-ci Please test

@natecook1000
Copy link
Member

@rgoldberg Thanks again for this fix!

@natecook1000 natecook1000 merged commit d8a9695 into apple:main May 19, 2025
27 checks passed
@rgoldberg rgoldberg deleted the 761-zsh-completion-argument-specs branch May 19, 2025 23:29
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.

valueName's containing colons are not escaped in completion scripts

2 participants