Source code

Revision control

Other Tools

1
function _mach()
2
{
3
local cur targets
4
COMPREPLY=()
5
6
# Calling `mach-completion` with -h/--help would result in the
7
# help text being used as the completion targets.
8
if [[ $COMP_LINE == *"-h"* || $COMP_LINE == *"--help"* ]]; then
9
return 0
10
fi
11
12
# Load the list of targets
13
targets=`"${COMP_WORDS[0]}" mach-completion ${COMP_LINE}`
14
cur="${COMP_WORDS[COMP_CWORD]}"
15
COMPREPLY=( $(compgen -W "$targets" -- ${cur}) )
16
return 0
17
}
18
complete -o default -F _mach mach