Skip to content

Instantly share code, notes, and snippets.

@zspencer
Created January 8, 2012 17:22
Show Gist options
  • Save zspencer/1579053 to your computer and use it in GitHub Desktop.
Save zspencer/1579053 to your computer and use it in GitHub Desktop.
Y U NO COMPLETE?!?!
_go()
{
word=${COMP_WORDS[COMP_CWORD]}
allwords= (ls $HOME/Projects)
COMPREPLY= $(compgen "-W '$allwords' $word")
}
complete -F _go go
#Doh. Need to surround the ls with ( parenthesis )
_go()
{
word=${COMP_WORDS[COMP_CWORD]}
allwords= ls $HOME/Projects
COMPREPLY= $(compgen "-W '$allwords' $word")
}
complete -F _go go
#At this point it always lists *all* the words. Not the word that I'm trimming down?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment