Created
March 19, 2019 16:08
-
-
Save vgaicuks/26e09e13e864ebf9d20f76cebf6b49fa to your computer and use it in GitHub Desktop.
Project autocomplete
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
#!/bin/bash | |
_projects() | |
{ | |
local curw | |
COMPREPLY=() | |
curw=${COMP_WORDS[COMP_CWORD]} | |
local projects=$(ls -1 ~/code) | |
COMPREPLY=($(compgen -W "$projects" -- $curw)); | |
return 0 | |
} | |
complete -o default -F _projects c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment