Simplify bash_completion.sh, return earlier in non-applicable environments.
This commit is contained in:
parent
8c24385c02
commit
f4f0984db2
@ -1,16 +1,12 @@
|
|||||||
# Check for bash (and that we haven't already been sourced).
|
# Check for interactive bash and that we haven't already been sourced.
|
||||||
[ -z "$BASH_VERSION" -o -n "$BASH_COMPLETION" ] && return
|
[ -z "$BASH_VERSION" -o -z "$PS1" -o -n "$BASH_COMPLETION" ] && return
|
||||||
|
|
||||||
# Check for recent enough version of bash.
|
# Check for recent enough version of bash.
|
||||||
bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
|
bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
|
||||||
|
if [ $bmajor -eq 2 -a $bminor '>' 04 ] || [ $bmajor -gt 2 ]; then
|
||||||
# Check for interactive shell.
|
if [ -r /etc/bash_completion ]; then
|
||||||
if [ -n "$PS1" ]; then
|
# Source completion code.
|
||||||
if [ $bmajor -eq 2 -a $bminor '>' 04 ] || [ $bmajor -gt 2 ]; then
|
. /etc/bash_completion
|
||||||
if [ -r /etc/bash_completion ]; then
|
|
||||||
# Source completion code.
|
|
||||||
. /etc/bash_completion
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
unset bash bminor bmajor
|
unset bash bminor bmajor
|
||||||
|
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -143,6 +143,7 @@ bash-completion (1:1.0-1) UNRELEASED; urgency=low
|
|||||||
* Make okular complete on same files as evince, thanks to Mary Ellen Foster
|
* Make okular complete on same files as evince, thanks to Mary Ellen Foster
|
||||||
(RHBZ: #486998).
|
(RHBZ: #486998).
|
||||||
* Apply ps2pdf completion to ps2pdf{12,13,14,wr} too.
|
* Apply ps2pdf completion to ps2pdf{12,13,14,wr} too.
|
||||||
|
* Simplify bash_completion.sh, return earlier in non-applicable environments.
|
||||||
|
|
||||||
[ Freddy Vulto ]
|
[ Freddy Vulto ]
|
||||||
* Restored `_display()' completion for `display' by removing
|
* Restored `_display()' completion for `display' by removing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user