-
Notifications
You must be signed in to change notification settings - Fork 391
fix: use _comp_compgen for COMPREPLY=($(compgen ...))
#955
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
878d7db
to
5e39a5e
Compare
f6cb373
to
af1cf9f
Compare
|
The cases in f00dfd0 and ac88694 are the ones originally without specifying any
|
af1cf9f
to
8d99393
Compare
scop
reviewed
May 7, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Pre-approved with some comments addressed.
807de76
to
614ede0
Compare
The IFS separators specified by the options `-s SEP` or `-l` option is intended to take effect in evaluating `compgen`, such as the word splitting in `-W text`. However, if we set IFS in a separate command from `compgen`, the arguments specified to `compgen` would also be unexpectedly affected. Here, ${_cur:+-- "$_cur"} is intended to be expanded to two words if `_cur` is non-empty. However, when the separators do not contain a whitespace, it unexpectedly results in a single word. IFS can be specified as a temporary environment of the `compgen` command so that it does not affect the arguments of `compgen`.
There are also more non-trivial cases where COMPREPLY is first constructed and then filtered by `_comp_compgen -- -W '"${COMPREPLY[@]}"'`, but they would conflict with forthcoming other PRs for _comp_compgen rewrite. We will address them after finishing the _comp_compgen-related PRs. Co-authored-by: Ville Skyttä <[email protected]>
3736999
to
70d0595
Compare
70d0595
to
7e49307
Compare
scop
approved these changes
May 8, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These are relatively trivial ones for the
_comp_compgen
rewriting.edit: #952 is blocking more, so could you see #952 before this?MergedNote: The commits "fix: use _comp_compgen for COMPREPLY=(...)" are essentially generated by
sed
: