Bug 950957 - Use ${COMP_WORDS[0]} for completion in mach. r=gps

This commit is contained in:
Martin Thomson
2013-12-19 11:42:19 -05:00
parent 86bab06b58
commit 0b7d70e8d4

View File

@@ -1,11 +1,10 @@
function _mach() function _mach()
{ {
local cur cmds c subcommand mach local cur cmds c subcommand
COMPREPLY=() COMPREPLY=()
# Load the list of commands # Load the list of commands
mach=`which mach || echo ./mach` cmds=`"${COMP_WORDS[0]}" mach-commands`
cmds=`$mach mach-commands`
# Look for the subcommand. # Look for the subcommand.
cur="${COMP_WORDS[COMP_CWORD]}" cur="${COMP_WORDS[COMP_CWORD]}"