Last active
August 29, 2015 14:05
-
-
Save drakeguan/9fbcd92aac7164b9daed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
_invoke() | |
{ | |
local cur prev opts | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" | |
opts=$(invoke -l | tail -n+3 | awk '{ print $1 }' | tr '\n' ' ') | |
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) | |
return 0 | |
} | |
complete -F _invoke invoke |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment