Skip to content

Instantly share code, notes, and snippets.

@ksaua
Created March 20, 2014 21:38
Show Gist options
  • Save ksaua/9674453 to your computer and use it in GitHub Desktop.
Save ksaua/9674453 to your computer and use it in GitHub Desktop.
function devel() { cd ~/public_html/devel/"$@"; }
alias dev='devel'
_dev()
{
local cur opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
opts=$(ls -d ~/public_html/devel/* | xargs -l basename | tr "\\n" " ")
COMPREPLY=( $(compgen -W "${opts}" ${cur}) )
}
complete -F _dev dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment