Le 12/02/2010 09:42, Adrian Bridgett a écrit :
seconded.  TBH I'd just like an option to turn off completion against
the network - it's not just the message but the fixe second hang that
really annoys me.
I second this: all slow completions should be configurable through environement variables, and probably disabled by default.

Here are the last two patches applied in mandriva bash-completion package for this purpose.
--
BOFH excuse #75:

There isn't any problem
diff -Naur -x '*~' -x '*.orig' -x '*.rej' bash-completion-20100203/contrib/rpm 
bash-completion-20100203-rpm-database/contrib/rpm
--- bash-completion-20100203/contrib/rpm        2010-02-02 19:02:26.000000000 
+0100
+++ bash-completion-20100203-rpm-database/contrib/rpm   2010-02-03 
23:05:49.000000000 +0100
@@ -17,8 +17,10 @@
         # SUSE's rpmqpack is faster than rpm -qa
         COMPREPLY=( $( compgen -W '$( rpmqpack )' -- "$cur" ) )
     else
-        _rpm_nodigsig
-        COMPREPLY=( $( rpm -qa $nodig $nosig --qf='%{NAME} ' "$cur*" ) )
+        if [ -n "${COMP_RPM_DATABASE:-}" ]; then
+            _rpm_nodigsig
+            COMPREPLY=( $( rpm -qa $nodig $nosig --qf='%{NAME} ' "$cur*" ) )
+        fi
     fi
 }
 
diff -Naur -x '*~' -x '*.rej' -x '*.orig' bash-completion-20100203/contrib/ssh 
bash-completion-20100203-scp-remote/contrib/ssh
--- bash-completion-20100203/contrib/ssh        2010-02-02 19:02:26.000000000 
+0100
+++ bash-completion-20100203-scp-remote/contrib/ssh     2010-02-03 
23:01:45.000000000 +0100
@@ -250,6 +250,9 @@
 # only.  Returns paths escaped with three backslashes.
 _scp_remote_files()
 {
+    # return if COMP_SCP_REMOTE is not set
+    [ -n "{$COMP_SCP_REMOTE:-}" ] || return 0
+
     local IFS=$'\t\n'
 
     # remove backslash escape from the first colon
_______________________________________________
Bash-completion-devel mailing list
Bash-completion-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/bash-completion-devel

Reply via email to