-
Notifications
You must be signed in to change notification settings - Fork 391
fix: add misc fixes before _parse_{help,usage}
changes
#950
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
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7fcf0c6
fix(badblocks): protect against `failglob`
akinomyoga a3071f3
fix(complete): remove empty elements
akinomyoga 86f9134
fix(_adb): avoid non-POSIX \? in BRE
akinomyoga 7bf4ec2
fix(gnokii): remove redundant LANG=C
akinomyoga 3a8a2ed
fix(gnokii): avoid non-POSIX BRE \|
akinomyoga fb130ad
fix(gnokii): avoid non-POSIX ERE \b
akinomyoga c7877e9
fix(_udevcmd): protect against `localvar_inherit`
akinomyoga 683a476
fix(_udevcmd): use param $2 of `_parse_help`
akinomyoga c609196
fix(postfix): use param $2 of `_parse_help`
akinomyoga 39a01d3
fix(gnokii): escape ERE special characters in constructed regex
akinomyoga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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.
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.
I guess this could end up as an invalid regex if
_parse_help
lets any strings through tomain_cmd
that make it so. The previous implementation had the same issue though, so not a regression. Leaving up to you to decide whether to address or merge as is.Some array utilities would be nice to help with cases like this. I have this ages old unfinished patch for the main
bash_completion
in my stash, probably broken in the first place and uses namerefs so requires bash >= 4.3, but to illustrate what I was thinking back $thenThere 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.
OK, I think I can try to escape special characters in
sed
in the previous line.Thank you for the suggestion. In this case, I indeed wanted to have something like
remove
andjoin
(like_comp_array_remove main_cmd '--config' '--phone'
and_comp_join '|' "${main_cmd[@]}"
). The suggesteduniq
,last_index
,compact
, andindex_of
do not seem to be specifically able to be used for the present case, but I guess your idea is to give names to array manipulations as independent functions.This might also be related to the discussion of
_comp_xfunc_ARRAY_filter
in #739.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.
I added a2d756e that escapes the ERE special characters.
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.
Array utilities are moved to #953