Skip to content

Instantly share code, notes, and snippets.

@rpedde
Last active December 28, 2015 22:28
Show Gist options
  • Save rpedde/7571524 to your computer and use it in GitHub Desktop.
Save rpedde/7571524 to your computer and use it in GitHub Desktop.
uberosc
#!/bin/bash
_uberosc() {
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "$(pushd ${HOME}/.osc > /dev/null 2>&1; ls *; popd > /dev/null 2>&1)" -- $cur) )
}
uberosc() {
local env=${1}
if [ -e ${HOME}/.osc/${env} ]; then
cp ${HOME}/.osc/${env} ${HOME}/.oscrc
rm -f ${HOME}/.osc_cookiejar
else
echo "Environment not found"
fi
}
complete -F _uberosc uberosc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment