completion/bash-it: rename _bash-it-comp()
...to `_bash-it()`. The norm is for the completion function for, e.g., `teh_cmd`. to be named with the same name and a prepended underscore, i.e. `_teh_cmd`. This alsö reduces namespace confusion, which will be relevant in a future patch.
This commit is contained in:
@@ -6,7 +6,7 @@ function _compreply_candidates() {
|
||||
read -d '' -ra COMPREPLY < <(compgen -W "${candidates[*]}" -- "${cur}")
|
||||
}
|
||||
|
||||
function _bash-it-comp() {
|
||||
function _bash-it() {
|
||||
local cur prev verb file_type candidates suffix
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
@@ -83,9 +83,9 @@ function _bash-it-comp() {
|
||||
}
|
||||
|
||||
# Activate completion for bash-it and its common misspellings
|
||||
complete -F _bash-it-comp bash-it
|
||||
complete -F _bash-it-comp bash-ti
|
||||
complete -F _bash-it-comp shit
|
||||
complete -F _bash-it-comp bashit
|
||||
complete -F _bash-it-comp batshit
|
||||
complete -F _bash-it-comp bash_it
|
||||
complete -F _bash-it bash-it
|
||||
complete -F _bash-it bash-ti
|
||||
complete -F _bash-it shit
|
||||
complete -F _bash-it bashit
|
||||
complete -F _bash-it batshit
|
||||
complete -F _bash-it bash_it
|
||||
|
||||
@@ -9,8 +9,8 @@ function local_setup {
|
||||
setup_test_fixture
|
||||
}
|
||||
|
||||
@test "completion bash-it: ensure that the _bash-it-comp function is available" {
|
||||
type -a _bash-it-comp &> /dev/null
|
||||
@test "completion bash-it: ensure that the _bash-it function is available" {
|
||||
type -a _bash-it &> /dev/null
|
||||
assert_success
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ function __check_completion () {
|
||||
COMP_CWORD=$(( ${#COMP_WORDS[@]} - 1 ))
|
||||
|
||||
# Run the Bash-it completion function
|
||||
_bash-it-comp
|
||||
_bash-it
|
||||
|
||||
# Return the completion output
|
||||
echo "${COMPREPLY[@]}"
|
||||
|
||||
Reference in New Issue
Block a user