Skip to content
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

[WIP] Array utilities #953

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft

[WIP] Array utilities #953

wants to merge 15 commits into from

Conversation

akinomyoga
Copy link
Collaborator

I decided to move code stubs for array utilities in #739 and #950 to here.

I guess this could end up as an invalid regex if _parse_help lets any strings through to main_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 $then

+_bashcomp_uniq()
[...]
+_bashcomp_last_index() {
[...]
+_bashcomp_compact() {
[...]
+_bashcomp_index_of() {
[...]

Originally posted by @scop in #950 (comment)

  • bc6f87d This implements a function _comp_array_filter. I'm not sure whether Ville would finally find it reasonable to include the function in bash-completion, but I tried to make the interface minimal (one function _comp_array_filter) yet make the function versatile as @calestyo would be likely to request. In any way, this function can be used for the array manipulations of general cases.

Originally posted by @akinomyoga in #739 (comment)

@akinomyoga
Copy link
Collaborator Author

Ref #432

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