Created
September 2, 2013 02:28
-
-
Save cizixs/6408740 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| _foo() | |
| { | |
| local cur prev opts | |
| COMPREPLY=() | |
| cur="${COMP_WORDS[COMP_CWORD]}" | |
| prev="${COMP_WORDS[COMP_CWORD-1]}" | |
| opts="--help --verbose --version" | |
| if [[ ${cur} == -* ]] ; then | |
| COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) | |
| return 0 | |
| fi | |
| } | |
| complete -F _foo foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment