Skip to content

Instantly share code, notes, and snippets.

@kaorimatz
Created November 18, 2012 13:34
Show Gist options
  • Save kaorimatz/4105290 to your computer and use it in GitHub Desktop.
Save kaorimatz/4105290 to your computer and use it in GitHub Desktop.
An bash completion specification for eclipse
function _eclipse {
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=()
if (($COMP_CWORD == 1)); then
local i
eclipse_home=$SOFTWARE/eclipse
COMPREPLY=( $( compgen -W '$( ls -d $eclipse_home-* )' $eclipse_home-$cur ) )
for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do
COMPREPLY[i]=${COMPREPLY[i]#$eclipse_home-}
done
fi
}
complete -F _eclipse eclipse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment