ENH: Reuse the todo.sh alias for completion #439
Merged
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.
Having to define a completion function wrapper is cumbersome. I had seen the trick of simply using
${COMP_WORDS[0]}
(i.e. the usedtodo.sh
command itself) from Paul Mansfield (https://github.com/the1ts/todo.txt-plugins/blob/develop/bash_completion/todo.txt#L7), which neatly avoids this.By keeping the
_todo_sh
variable, this is a one-line change and it still allows the old way of using the override in a wrapper function. (So users aren't forced to change their customizations when upgrading.)Tests are adapted to verify that the alias is used, and still verify the wrapper function as well.
The documentation is simplified because there's normally no need for the completion wrapper function.
Before submitting a pull request, please make sure the following is done:
master
.Steps for the reviewer(s) on how they can manually QA the changes.Have afixes #XX
reference to the issue that this pull request fixes.