Skip to content

doc(api-and-naming): add rules for xfuncs and generators #993

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 5 commits into from
May 29, 2023

Conversation

akinomyoga
Copy link
Collaborator

Document the naming rules and implementation advices for xfuncs and _comp_compgen_NAME

#954 (comment)
#964
#962 (comment)

Note: _comp_compegn [-i CMD|-x CMD] are not yet impl;emented.

Copy link
Owner

@scop scop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good to me, just a few small comments.

Kind of a head scratcher is that per this definition, I guess the majority of functions would actually be generators, and we'd be up for another round of renamings to bring them up to spec 🤔

Another thing is choosing between options 2 and 3 for internal generators per #962 (reply in thread)

@akinomyoga
Copy link
Collaborator Author

Kind of a head scratcher is that per this definition, I guess the majority of functions would actually be generators, and we'd be up for another round of renamings to bring them up to spec 🤔

For the utility functions defined in bash_completion, I was thinking about adjusting them at the same time as the renaming. E.g., directly renaming _filedir => _comp_compgen_filedir instead of _filedir => _comp_filedir => _comp_compgen_filedir. For other functions defined in specific completion files, as far as the function is used only in a particular way (e.g., the target is fixed to be COMPREPLY, etc.), I was thinking that they don't necessarily need to be updated to be generators soon.

Another thing is choosing between options 2 and 3 for internal generators per #962 (reply in thread)

I left a comment at #962 (reply in thread).

@akinomyoga
Copy link
Collaborator Author

akinomyoga commented May 28, 2023

9cd10f7 I added an implementation of -i cmd and -x cmd (along with other minor fixes 8ae00a8, 5e6cbf4).

Copy link
Owner

@scop scop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, pre-approved after addressing the apparent conflict in the docs with regards to referencing/modifying target vars in generators.

@akinomyoga akinomyoga force-pushed the _comp_compgen-doc branch from 27cd492 to 39cc200 Compare May 28, 2023 20:02
@scop scop merged commit cb24709 into scop:master May 29, 2023
@scop
Copy link
Owner

scop commented May 29, 2023

Cheers 👍

@akinomyoga akinomyoga deleted the _comp_compgen-doc branch May 29, 2023 11:23
@akinomyoga
Copy link
Collaborator Author

Thanks!

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