Skip to content

Instantly share code, notes, and snippets.

@mschuerig
Created July 18, 2014 08:14
Show Gist options
  • Save mschuerig/d46eae6541139480ea07 to your computer and use it in GitHub Desktop.
Save mschuerig/d46eae6541139480ea07 to your computer and use it in GitHub Desktop.
Yeoman yo bash completion for generators
_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