X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=.profile.d%2Fcompletion.bashrc;h=e18ec39bf531122b9da00531b4061431024d7527;hb=31189bc241721bf1e1b38dd31875fa6093b64e74;hp=fa86e5ea932e345e505ce03043c2a4b9e78c7438;hpb=9e07d4e358e5b0c7e9e9a949fab7293e770af6c5;p=profile.git diff --git a/.profile.d/completion.bashrc b/.profile.d/completion.bashrc index fa86e5e..e18ec39 100644 --- a/.profile.d/completion.bashrc +++ b/.profile.d/completion.bashrc @@ -2,7 +2,7 @@ # Helper! export COMPLETION_DIR_SSH=~/.ssh/hosts export COMPLETION_DIR_TELNET=~/.telnet/hosts -export COMPLETION_DIR_RDP=~/.ssh/hosts +export COMPLETION_DIR_RDP=~/.rdp/hosts export COMPLETION_DIR_PING="$COMPLETION_DIR_SSH $COMPLETION_DIR_TELNET $COMPLETION_DIR_RDP" function _generic_completion() { @@ -103,6 +103,15 @@ function _rmmod() { return 0 } +# Find tags with GNU GLOBAL. +function _global() { + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + + COMPREPLY=($(global -c "$cur")) + return 0 +} + complete -F _ssh rollout complete -F _ssh ssh complete -F _ssh sshterm @@ -120,8 +129,4 @@ complete -F _known_hosts kill_known_host complete -F _known_hosts knh complete -F _modprobe modprobe complete -F _rmmod rmmod - -unset COMPLETION_DIR_PING -unset COMPLETION_DIR_RDP -unset COMPLETION_DIR_SSH -unset COMPLETION_DIR_TELNET +complete -F _global global