Skip to content

Instantly share code, notes, and snippets.

@laubstein
Created April 16, 2015 13:01
Show Gist options
  • Save laubstein/c049e9c05a437791e8cd to your computer and use it in GitHub Desktop.
Save laubstein/c049e9c05a437791e8cd to your computer and use it in GitHub Desktop.
Yeoman Available Generators Bash Completion
#!/bin/bash
_yo_complete()
{
local cur_word prev_word type_list
cur_word="${COMP_WORDS[COMP_CWORD]}"
prev_word="${COMP_WORDS[COMP_CWORD-1]}"
type_list=`yo --help | tail -n+8`
COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )
return 0
}
complete -F _yo_complete yo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment