Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _complete_proj() {
- cur="${COMP_WORDS[COMP_CWORD]}"
- opts=$( find -X ~/projects -name ${cur}* -maxdepth 1 -type d -prune | xargs basename )
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0;
- }
- proj() {
- cd ~/projects/$1
- }
- complete -F _complete_proj proj
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement