Created
January 8, 2012 17:22
-
-
Save zspencer/1579053 to your computer and use it in GitHub Desktop.
Y U NO COMPLETE?!?!
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
_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 ) |
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
_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