bash completion: --options for brew install foo
To trigger the option autocompletion, type:
brew install foo --[tab][tab]
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
parent
9752fc93fd
commit
97b8f9a31f
@ -39,6 +39,13 @@ _brew_to_completion()
|
|||||||
COMPREPLY=( $(compgen -W "$(\ls $(brew --cellar))" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$(\ls $(brew --cellar))" -- ${cur}) )
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
|
# Complete --options for selected brew
|
||||||
|
*)
|
||||||
|
[[ ${COMP_WORDS[1]} == "install" ]] && [[ "$cur" == --* ]] && {
|
||||||
|
COMPREPLY=( $(compgen -W "$(brew options "$prev" | grep -P "^--")" -- ${cur}) )
|
||||||
|
return
|
||||||
|
}
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user