Created
July 18, 2014 08:14
-
-
Save mschuerig/d46eae6541139480ea07 to your computer and use it in GitHub Desktop.
Yeoman yo bash completion for generators
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
_yo() { | |
local cur prev words cword generators | |
_get_comp_words_by_ref -n : cur prev words cword | |
generators=$( \ | |
yo --help \ | |
| sed -n '/Please choose a generator below./{:a;n;/-----------------------------------------/b;p;ba}' \ | |
| sed -n '/^ /p' \ | |
) | |
COMPREPLY=( $(compgen -W "$generators" -- $cur )) | |
__ltrim_colon_completions "$cur" | |
return 0 | |
} | |
complete -F _yo yo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment