Skip to content

feat: add _comp_xfunc #734

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 3 commits into from
Apr 14, 2022
Merged

feat: add _comp_xfunc #734

merged 3 commits into from
Apr 14, 2022

Conversation

akinomyoga
Copy link
Collaborator

@akinomyoga akinomyoga commented Apr 11, 2022

Resolve #732

  • 2c7ca22 add _comp_xfunc
  • 2b4bb19 use _comp_xfunc instead of _xfunc
  • fc0b4b8 add _comp_deprecate_func for backward-compatibility names

The function _comp_deprecate_func is introduced to later automatically detect the use of old function names for #542. To implement #542, some codes can be added in the automatically generated function body in _comp_deprecate_func.

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, thanks!

Left a bunch of rather trivial comments, pre-approved with those addressed, but feel free to bounce back if you think they deserve more discussion or I missed something.

@akinomyoga akinomyoga force-pushed the _comp_xfunc branch 2 times, most recently from d51f6dc to 21f5a61 Compare April 12, 2022 21:38
@akinomyoga
Copy link
Collaborator Author

akinomyoga commented Apr 12, 2022

I have rebased and squashed the changes. For the additional changes compared to the previous version, I have made comments of the commit hashes in each conversation.

@akinomyoga
Copy link
Collaborator Author

Now I noticed that there can be a case where an external completion calls any function that is not marked xfunc by us through _xfunc. Maybe we need to still allow such cases for backward compatibility as 35fbf57, or do we recommend continuing to use the deprecated _xfunc in such a case? Hmm, what do you think?

@scop
Copy link
Owner

scop commented Apr 13, 2022

35fbf57 makes sense to me. With that, couldn't we just _comp_deprecate_func _xfunc _comp_xfunc considering that our separate completion files don't have any functions that would not start with an underscore?

@akinomyoga akinomyoga force-pushed the _comp_xfunc branch 2 times, most recently from 2420e14 to 11a6f4f Compare April 13, 2022 21:43
@akinomyoga
Copy link
Collaborator Author

Thank you!

  • ce9b010 I have supplemented 35fbf57 with an appropriate update of the description
  • ffb59f4 I have moved _comp_deprecate_func to the beginning of the file to use it for functions defined in the main bash_completion, and applied it to _comp_xfunc
  • f8a6a09 I have added input checks to _comp_deprecate_func

I have rebased and squashed.

@scop scop merged commit eb94fb1 into scop:master Apr 14, 2022
@scop
Copy link
Owner

scop commented Apr 14, 2022

Nice! I took the liberty to fix the completions/ssh conflict my push last night caused in your repo, force-pushed there and merged here.

@akinomyoga akinomyoga deleted the _comp_xfunc branch April 15, 2022 01:33
@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.

Implement new _comp_xfunc and naming
2 participants