bash-completion
bash-completion copied to clipboard
[Need discussion (cf #814)] refactor(_command_offset): implement Bash's $2 passed to completion functions
This includes a fix of #790, the renaming of the functions _command_offset
, _command
, and _root_command
as suggested in #539, and also other refactorings.
- c59655c4 fix #790: This mimics the behavior of Bash that I observed in tests. The rule of modifying the current word is described in the code comments of
_comp_command_offset__reduce_cur
.
Fixes #790
Edit: I have separated changes to other PRs: #796, #797, #798, and #799.
Thank you. I'll split the PR.
The rest of the refactorings/cleanups here are quite understandable and nice, I'd be happy to work on getting them merged first, and see about the actual fix for #790 i.e. c59655c separately.
I have completed splitting the PR. #796, #797, #798, and #799. This PR actually depends on the change in #798, so the test of this PR will now fail. Also, this PR conflicts with the change in #799. I thought #797 would also conflict with the change remaining in this PR, but #797 turned out to be actually independent. Edit: For the sake of completeness, this PR also conflicts with #793. If this PR is merged first, maybe I'll resolve the conflicts.
I have created an alternative fix at PR #814 to discuss which approach is better.
Closing in favor of #814.