Skip to content

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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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 from 17fe180 to 578f2a7 Compare May 13, 2025 23:55
… 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 578f2a7 to 716f132 Compare May 18, 2025 23:01
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
1 participant