Skip to content

Instantly share code, notes, and snippets.

@omerucel
Last active December 15, 2015 15:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omerucel/5284802 to your computer and use it in GitHub Desktop.
Save omerucel/5284802 to your computer and use it in GitHub Desktop.
bash function for virtualenv
function mood()
{
cmd=". $HOME/.env/$1/bin/activate"
$cmd
}
_mood()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
local projects=$(ls -h $HOME/.env)
COMPREPLY=( $(compgen -W "${projects}" ${cur}) )
}
complete -F _mood mood

Konsolda kullanımı :

$ mood test-project

Tüm projeleri listlersiniz : mood [TAB][TAB] Otomatik tamamlama : mood s[TAB]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment