X-Git-Url: http://id.pley.net/dotfiles.git/blobdiff_plain/eaa23ff9f75b7242773ccc3214fa3aea21730d8c..ede54eb541ad5864402cc48bd9312049e5bb9b92:/.webkit_login?ds=sidebyside diff --git a/.webkit_login b/.webkit_login index 7d1e52f..d99772a 100644 --- a/.webkit_login +++ b/.webkit_login @@ -1,4 +1,20 @@ #!/bin/bash -export WEBKIT_DIR=~/Projects/WebKit.git -source ${WEBKIT_DIR}/webkitenv \ No newline at end of file +function switchto() { + export WEBKIT_DIR=~/Projects/WebKit.$1 + if [[ -f ${WEBKIT_DIR}/webkitenv ]]; then + source ${WEBKIT_DIR}/webkitenv + fi +} + +function _switchto_complete() { + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + opts=$( for dir in ~/Projects/WebKit.*; do echo ${dir##*.}; done ) + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 +} + +complete -F _switchto_complete switchto + +switchto PuzzleBox \ No newline at end of file