[Bash-completion-commits] [bash-completion] 01/01: ssh: Avoid completing commands before hostname

Ville Skyttä scop-guest at moszumanska.debian.org
Fri Dec 25 12:56:32 UTC 2015


This is an automated email from the git hooks/post-receive script.

scop-guest pushed a commit to branch master
in repository bash-completion.

commit f8f6ffa72ed3db9c6628b50f1bd3ef9582b4f264
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Fri Dec 25 14:56:22 2015 +0200

    ssh: Avoid completing commands before hostname
    
    This isn't a complete fix as preceding options with arguments will trip
    _count_args, but it's better than previously.
---
 completions/ssh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/completions/ssh b/completions/ssh
index f3380e7..9a8e0c6 100644
--- a/completions/ssh
+++ b/completions/ssh
@@ -210,7 +210,10 @@ _ssh()
             shift
         done
         _known_hosts_real -a -F "$configfile" "$cur"
-        if [[ $cword -ne 1 ]]; then
+
+        local args
+        _count_args
+        if [[ $args -gt 1 ]]; then
             compopt -o filenames
             COMPREPLY+=( $( compgen -c -- "$cur" ) )
         fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/bash-completion/bash-completion.git



More information about the Bash-completion-commits mailing list