[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 8358f35def9107515353683838f234081ba7d1c3

Freddy Vulto fvulto at gmail.com
Thu Jun 18 19:53:04 UTC 2009


The following commit has been merged in the master branch:
commit 127eaafb540433ed55089691dd3b9e001c92e5b9
Author: Freddy Vulto <fvulto at gmail.com>
Date:   Thu Jun 18 21:51:01 2009 +0200

    Fixed calls to _known_hosts_real
    Made _known_hosts_real raise error if there are unprocessed arguments.

diff --git a/bash_completion b/bash_completion
index 9bc8e3c..845a099 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1084,6 +1084,8 @@ _known_hosts_real()
 			p) prefix=$OPTARG ;;
 		esac
 	done
+	[ $# -ge $OPTIND ] && echo "error: $FUNCNAME("$@"): unprocessed arguments:"\
+	    $(while [ $# -gt 0 ]; do echo ${!OPTIND}; shift; done)
 
 	[[ $cur == *@* ]] && user=${cur%@*}@ && cur=${cur#*@}
 	kh=()
diff --git a/contrib/ssh b/contrib/ssh
index f50d07f..4244b62 100644
--- a/contrib/ssh
+++ b/contrib/ssh
@@ -94,7 +94,7 @@ _ssh()
 			fi
 			shift
 		done
-		_known_hosts_real -a "$optconfigfile" -h "$cur"
+		_known_hosts_real -a -h "$cur" $optconfigfile 
 		if [ $COMP_CWORD -ne 1 ]; then
 			COMPREPLY=( "${COMPREPLY[@]}" $( compgen -c -- $cur ) )
 		fi
@@ -144,7 +144,7 @@ _sftp()
 			fi
 			shift
 		done
-		_known_hosts_real -a "$optconfigfile" -h "$cur"
+		_known_hosts_real -a -h "$cur" $optconfigfile 
 	fi
 
 	return 0
@@ -200,7 +200,7 @@ _scp()
 		shift
 	done
 
-	[[ "$cur" == */* ]] || _known_hosts_real -c -a "$optconfigfile" -h "$cur"
+	[[ "$cur" == */* ]] || _known_hosts_real -c -a -h "$cur" $optconfigfile 
 
 	# This approach is used instead of _filedir to get a space appended
 	# after local file/dir completions, and $nospace retained for others.

-- 
bash-completion



More information about the Bash-completion-commits mailing list