]> git.phdru.name Git - dotfiles.git/commitdiff
.shellrc: add completion for rsync/ssh/wget wrappers
authorOleg Broytman <phd@phdru.name>
Mon, 8 Aug 2016 01:45:10 +0000 (04:45 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 8 Aug 2016 01:45:10 +0000 (04:45 +0300)
.shellrc

index 0b880623b992fb2d89e7809b3eeb6b2a29274002..2f7e05bab78d7854c05b7cfd87a90add4e8de835 100644 (file)
--- a/.shellrc
+++ b/.shellrc
@@ -113,13 +113,37 @@ if test -n "$BASH_VERSION"; then
    done
 
    if has_completion wget; then
-      complete -F _wget wget-m wget-wrapper ww
+      _wget_completion_loader() {
+         _completion_loader wget
+         complete -F _wget wget-m wget-wrapper ww
+         return 124
+      }
+      complete -F _wget_completion_loader wget-m wget-wrapper ww
    fi
 
    for cmd in distribute ftp lftp r rsync \
       s scp ssh smbclient tcpdump tshark wireshark; do
          ! has_completion $cmd && complete -o default -A hostname $cmd;
    done
+
+   if has_completion rsync; then
+      _rsync_completion_loader() {
+         _completion_loader rsync
+         complete -F _rsync r
+         return 124
+      }
+      complete -F _rsync_completion_loader r
+   fi
+
+   if has_completion ssh; then
+      _ssh_completion_loader() {
+         _completion_loader ssh
+         complete -F _ssh s
+         return 124
+      }
+      complete -F _ssh_completion_loader s
+   fi
+
    unset has_completion
 
    complete -A job bg fg j jobs wait