| 1 |
_celery_completion() { |
| 2 |
local IFS=$' |
| 3 |
' |
| 4 |
COMPREPLY=( $( env COMP_WORDS="${COMP_WORDS[*]}" \ |
| 5 |
COMP_CWORD=$COMP_CWORD \ |
| 6 |
_CELERY_COMPLETE=complete $1 ) ) |
| 7 |
return 0 |
| 8 |
} |
| 9 |
|
| 10 |
_celery_completionetup() { |
| 11 |
local COMPLETION_OPTIONS="" |
| 12 |
local BASH_VERSION_ARR=(${BASH_VERSION//./ }) |
| 13 |
# Only BASH version 4.4 and later have the nosort option. |
| 14 |
if [ ${BASH_VERSION_ARR[0]} -gt 4 ] || ([ ${BASH_VERSION_ARR[0]} -eq 4 ] && [ ${BASH_VERSION_ARR[1]} -ge 4 ]); then |
| 15 |
COMPLETION_OPTIONS="-o nosort" |
| 16 |
fi |
| 17 |
|
| 18 |
complete $COMPLETION_OPTIONS -F _celery_completion celery |
| 19 |
} |
| 20 |
|
| 21 |
_celery_completionetup; |