- use $BASH_COMPLETION_DIR to determine where loose completon scripts are
This commit is contained in:
parent
0287b238b2
commit
298fe3cce4
@ -1,6 +1,6 @@
|
|||||||
# bash_completion - some programmable completion functions for bash 2.05a
|
# bash_completion - some programmable completion functions for bash 2.05a
|
||||||
#
|
#
|
||||||
# $Id: bash_completion,v 1.193 2002/03/11 02:15:09 ianmacd Exp $
|
# $Id: bash_completion,v 1.194 2002/03/11 18:38:17 ianmacd Exp $
|
||||||
#
|
#
|
||||||
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
||||||
#
|
#
|
||||||
@ -25,6 +25,8 @@
|
|||||||
# Alter the following to reflect the location of this file
|
# Alter the following to reflect the location of this file
|
||||||
#
|
#
|
||||||
[ -z "$BASH_COMPLETION" ] && declare -r BASH_COMPLETION=/etc/bash_completion
|
[ -z "$BASH_COMPLETION" ] && declare -r BASH_COMPLETION=/etc/bash_completion
|
||||||
|
[ -z "$BASH_COMPLETION_DIR" ] && \
|
||||||
|
declare -r BASH_COMPLETION_DIR=/etc/bash_completion.d
|
||||||
|
|
||||||
# Set a couple of useful vars
|
# Set a couple of useful vars
|
||||||
#
|
#
|
||||||
@ -1623,7 +1625,8 @@ _iptables()
|
|||||||
|
|
||||||
case "$prev" in
|
case "$prev" in
|
||||||
-*[AIDPFXL])
|
-*[AIDPFXL])
|
||||||
COMPREPLY=( $( compgen -W '`iptables $table -nL | sed -ne "s/^Chain \([^ ]\+\).*$/\1/p"`' -- $cur ) )
|
COMPREPLY=( $( compgen -W '`iptables $table -nL | \
|
||||||
|
sed -ne "s/^Chain \([^ ]\+\).*$/\1/p"`' -- $cur ) )
|
||||||
;;
|
;;
|
||||||
-*t)
|
-*t)
|
||||||
COMPREPLY=( $( compgen -W 'nat filter mangle' -- $cur ) )
|
COMPREPLY=( $( compgen -W 'nat filter mangle' -- $cur ) )
|
||||||
@ -2563,10 +2566,11 @@ fi
|
|||||||
unset list[@]
|
unset list[@]
|
||||||
|
|
||||||
# source completion directory definitions
|
# source completion directory definitions
|
||||||
for i in /etc/bash_completion.d/*; do
|
if [ -r $BASH_COMPLETION_DIR -a -x $BASH_COMPLETION_DIR ]; then
|
||||||
[ -r $i ] && . $i
|
for i in $BASH_COMPLETION_DIR/*; do
|
||||||
done
|
[ -r $i ] && . $i
|
||||||
|
done
|
||||||
|
fi
|
||||||
# source user completion file
|
# source user completion file
|
||||||
[ $BASH_COMPLETION != ~/.bash_completion -a -r ~/.bash_completion ] \
|
[ $BASH_COMPLETION != ~/.bash_completion -a -r ~/.bash_completion ] \
|
||||||
&& . ~/.bash_completion
|
&& . ~/.bash_completion
|
||||||
|
Loading…
x
Reference in New Issue
Block a user