delegate_completion() {
local prog programs
prog=$1
- if has_completion $prog; then
- shift
- programs="$@"
- eval "_${prog}_completion_loader() {
- _completion_loader $prog
- complete -o nospace -F _$prog $programs
- unset _${prog}_completion_loader
- return 124
- }"
- complete -F _${prog}_completion_loader $programs
- fi
+ ! has_completion $prog && return
+ shift
+ programs="$@"
+ eval "_${prog}_completion_loader() {
+ _completion_loader $prog
+ complete -o nospace -F _$prog $programs
+ unset _${prog}_completion_loader
+ return 124
+ }"
+ complete -F _${prog}_completion_loader $programs
}
delegate_completion make m