X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=.profile.d%2Fcompletion.bashrc;h=775c20891255d9521945a27dc129a7bd3aaf8472;hb=76559e10296433ab488b9d9940c50a39282ee49a;hp=fbec1446db7464595517b0ce5f93dedf3bf3fc79;hpb=639e80622b3e3c4db3c4a3ca035ef6f732cb797a;p=profile.git diff --git a/.profile.d/completion.bashrc b/.profile.d/completion.bashrc index fbec144..775c208 100644 --- a/.profile.d/completion.bashrc +++ b/.profile.d/completion.bashrc @@ -1,8 +1,7 @@ -# $Id$ # 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() { @@ -85,7 +84,7 @@ function _modprobe() { COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} - ver=$(uname -r) + ver=$KERNEL MODULES="$(find /lib/modules/$ver -name \*.ko | sed -n 's@^.*/\([^/]*\).ko$@\1@p')" COMPREPLY=($(compgen -W "$MODULES" -- "$cur")) @@ -103,6 +102,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 @@ -117,5 +125,7 @@ complete -F _process killall complete -F _pid kill complete -F _pid strace complete -F _known_hosts kill_known_host +complete -F _known_hosts knh complete -F _modprobe modprobe complete -F _rmmod rmmod +complete -F _global global