Trim trailing whitespace (cosmetic, no functional changes).
This commit is contained in:
parent
328bd60242
commit
c6360dde51
@ -214,7 +214,7 @@ quote()
|
||||
echo \'${1//\'/\'\\\'\'}\' #'# Help vim syntax highlighting
|
||||
}
|
||||
|
||||
# This function quotes the argument in a way so that readline dequoting
|
||||
# This function quotes the argument in a way so that readline dequoting
|
||||
# results in the original argument
|
||||
quote_readline()
|
||||
{
|
||||
@ -265,9 +265,9 @@ _get_cword()
|
||||
index="$(( index - old_size + new_size ))"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
if [[ "${COMP_WORDS[COMP_CWORD]:0:${#cur}}" != "$cur" ]]; then
|
||||
# We messed up! At least return the whole word so things
|
||||
# We messed up! At least return the whole word so things
|
||||
# keep working
|
||||
printf "%s" "${COMP_WORDS[COMP_CWORD]}"
|
||||
else
|
||||
@ -289,16 +289,16 @@ _filedir()
|
||||
|
||||
local -a toks
|
||||
local tmp
|
||||
|
||||
|
||||
# TODO: I've removed a "[ -n $tmp ] &&" before `echo $tmp',
|
||||
# and everything works again. If this bug
|
||||
# suddenly appears again (i.e. "cd /b<TAB>"
|
||||
# becomes "cd /"), remember to check for
|
||||
# other similar conditionals (here and
|
||||
# _filedir_xspec()). --David
|
||||
# NOTE: The comment above has been moved outside of the subshell below,
|
||||
# NOTE: The comment above has been moved outside of the subshell below,
|
||||
# because quotes-in-comments-in-a-subshell cause errors on
|
||||
# bash-3.1. See also:
|
||||
# bash-3.1. See also:
|
||||
# http://www.mail-archive.com/bug-bash@gnu.org/msg01667.html
|
||||
toks=( ${toks[@]-} $(
|
||||
compgen -d -- "$(quote_readline "$cur")" | {
|
||||
@ -307,7 +307,7 @@ _filedir()
|
||||
done
|
||||
}
|
||||
))
|
||||
|
||||
|
||||
if [[ "$1" != -d ]]; then
|
||||
xspec=${1:+"!*.$1"}
|
||||
toks=( ${toks[@]-} $(
|
||||
@ -732,7 +732,7 @@ _chgrp()
|
||||
fi
|
||||
|
||||
$split && return 0
|
||||
|
||||
|
||||
# options completion
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes \
|
||||
@ -1048,7 +1048,7 @@ _user_at_host() {
|
||||
}
|
||||
shopt -u hostcomplete && complete -F _user_at_host $nospace talk ytalk finger
|
||||
|
||||
# NOTE: Using this function as a helper function is deprecated. Use
|
||||
# NOTE: Using this function as a helper function is deprecated. Use
|
||||
# `_known_hosts_real' instead.
|
||||
_known_hosts()
|
||||
{
|
||||
@ -1354,7 +1354,7 @@ _command_offset()
|
||||
# get function name
|
||||
func=${cspec#*-F }
|
||||
func=${func%% *}
|
||||
|
||||
|
||||
if [[ ${#COMP_WORDS[@]} -ge 2 ]]; then
|
||||
$func $cmd "${COMP_WORDS[${#COMP_WORDS[@]}-1]}" "${COMP_WORDS[${#COMP_WORDS[@]}-2]}"
|
||||
else
|
||||
@ -1498,7 +1498,7 @@ _filedir_xspec()
|
||||
done
|
||||
}
|
||||
))
|
||||
|
||||
|
||||
toks=( ${toks[@]-} $(
|
||||
eval compgen -f -X "$xspec" -- "\$(quote_readline "\$cur")" | {
|
||||
while read -r tmp; do
|
||||
@ -1506,7 +1506,7 @@ _filedir_xspec()
|
||||
done
|
||||
}
|
||||
))
|
||||
|
||||
|
||||
COMPREPLY=( "${toks[@]}" )
|
||||
}
|
||||
list=( $( sed -ne '/^# START exclude/,/^# FINISH exclude/p' \
|
||||
@ -1538,7 +1538,7 @@ if [ -d $BASH_COMPLETION_COMPAT_DIR -a -r $BASH_COMPLETION_COMPAT_DIR -a \
|
||||
-x $BASH_COMPLETION_COMPAT_DIR ]; then
|
||||
for i in $BASH_COMPLETION_COMPAT_DIR/*; do
|
||||
[[ ${i##*/} != @(*~|*.bak|*.swp|\#*\#|*.dpkg*|*.rpm@(orig|new|save)) ]] &&
|
||||
[ \( -f $i -o -h $i \) -a -r $i ] && . $i
|
||||
[ \( -f $i -o -h $i \) -a -r $i ] && . $i
|
||||
done
|
||||
fi
|
||||
if [ -d $BASH_COMPLETION_DIR -a -r $BASH_COMPLETION_DIR -a \
|
||||
|
@ -6,12 +6,12 @@
|
||||
have apache2ctl && {
|
||||
_apache2ctl() {
|
||||
local APWORDS
|
||||
|
||||
|
||||
COMPREPLY=()
|
||||
cur=`_get_cword`
|
||||
|
||||
|
||||
APWORDS=$(apache2ctl 2>&1 >/dev/null | head -n1 | cut -f3 -d" " | tr "|" " ")
|
||||
|
||||
|
||||
COMPREPLY=( $( compgen -W "$APWORDS" -- "$cur" ) )
|
||||
}
|
||||
complete -F _apache2ctl apache2ctl
|
||||
|
@ -116,7 +116,7 @@ _apt_cache()
|
||||
uniq | cut -f2 -d" " ) )
|
||||
return 0
|
||||
;;
|
||||
|
||||
|
||||
*)
|
||||
COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) )
|
||||
return 0
|
||||
|
@ -31,7 +31,7 @@ _bluetooth_packet_types()
|
||||
$cur ) )
|
||||
}
|
||||
|
||||
_get_command()
|
||||
_get_command()
|
||||
{
|
||||
local i
|
||||
|
||||
@ -163,7 +163,7 @@ _sdptool()
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--bdaddr \
|
||||
--tree --raw --xml' -- $cur ) )
|
||||
else
|
||||
else
|
||||
_bluetooth_services
|
||||
fi
|
||||
;;
|
||||
@ -171,7 +171,7 @@ _sdptool()
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--tree \
|
||||
--raw --xml' -- $cur ) )
|
||||
else
|
||||
else
|
||||
_bluetooth_adresses
|
||||
fi
|
||||
;;
|
||||
@ -352,7 +352,7 @@ _hciconfig()
|
||||
voice iac inqmode inqdata inqtype inqparams \
|
||||
pageparms pageto afhmode aclmtu scomtu putkey \
|
||||
delkey commands features version revision lm' \
|
||||
-- $cur ) )
|
||||
-- $cur ) )
|
||||
fi
|
||||
else
|
||||
case $command in
|
||||
|
@ -8,12 +8,12 @@ _cksfv()
|
||||
{
|
||||
COMPREPLY=()
|
||||
cur=`_get_cword`
|
||||
|
||||
|
||||
if [ $COMP_CWORD -eq 1 ]; then
|
||||
COMPREPLY=( $( compgen -W '-C -f -i -q -v' -- $cur ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
||||
case "${COMP_WORDS[$COMP_CWORD-1]}" in
|
||||
-C)
|
||||
_filedir -d
|
||||
@ -24,7 +24,7 @@ _cksfv()
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
_filedir
|
||||
return 0
|
||||
} &&
|
||||
|
@ -39,7 +39,7 @@ _cpan2dist()
|
||||
done
|
||||
COMPREPLY=( $( zgrep "^${cur//-/::}" \
|
||||
$packagelist 2>/dev/null \
|
||||
| awk '{print $1}' | sed -e 's/::/-/g' ) )
|
||||
| awk '{print $1}' | sed -e 's/::/-/g' ) )
|
||||
fi
|
||||
} &&
|
||||
complete -F _cpan2dist $default cpan2dist
|
||||
|
@ -27,7 +27,7 @@ _gnatmake()
|
||||
else
|
||||
# source file completion
|
||||
_filedir '@(adb|ads)'
|
||||
|
||||
|
||||
fi
|
||||
} &&
|
||||
complete -F _gnatmake $filenames gnatmake
|
||||
|
@ -7,11 +7,11 @@ have gpg2 && {
|
||||
_gpg2 ()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
|
||||
COMPREPLY=()
|
||||
cur=`_get_cword`
|
||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
|
||||
|
||||
case "$prev" in
|
||||
--homedir)
|
||||
_filedir -d
|
||||
@ -34,7 +34,7 @@ _gpg2 ()
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-s -b -e -c -d -k -K -a -r -u -z -o -v \
|
||||
-n -N -i -h -R -t $(gpg2 --dump-options)' -- $cur ) )
|
||||
|
@ -522,7 +522,7 @@ _stream()
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-authenticate -channel -colorspace \
|
||||
-compress -debug -define -density -depth -extract \
|
||||
-compress -debug -define -density -depth -extract \
|
||||
-help -identify -interlace -interpolate -limit -list \
|
||||
-log -map -monitor -quantize -quiet -regard-warnings \
|
||||
-respect-parenthesis -sampling-factor -seed -set \
|
||||
|
@ -8,7 +8,7 @@ _isql()
|
||||
{
|
||||
local cur
|
||||
cur=`_get_cword`
|
||||
|
||||
|
||||
[ -f "$ODBCINI" ] && COMPREPLY=( $( grep \\[$cur "$ODBCINI" | tr -d \\[\\] ) )
|
||||
} &&
|
||||
complete -F _isql isql
|
||||
|
@ -75,12 +75,12 @@ _java_classes()
|
||||
|
||||
elif [ -d $i ]; then
|
||||
i=${i%/}
|
||||
|
||||
|
||||
# See Debian bug #496828
|
||||
COMPREPLY=( "${COMPREPLY[@]}" $( find "$i" -type f \
|
||||
-maxdepth 1 -path "$i/$cur*.class" 2>/dev/null | \
|
||||
grep -v "\\$" | sed -e "s|^$i/||" ) )
|
||||
|
||||
|
||||
# FIXME: if we have foo.class and foo/, the completion
|
||||
# returns "foo/"... how to give precedence to files
|
||||
# over directories?
|
||||
|
@ -424,7 +424,7 @@ _arch()
|
||||
1)
|
||||
_mailman_lists
|
||||
;;
|
||||
2)
|
||||
2)
|
||||
_filedir
|
||||
;;
|
||||
esac
|
||||
|
@ -63,7 +63,7 @@ _make()
|
||||
|
||||
[ -n "$makef" ] && makef="-f ${makef}"
|
||||
[ -n "$makef_dir" ] && makef_dir="-C ${makef_dir}"
|
||||
|
||||
|
||||
COMPREPLY=( $( compgen -W "$( make -qp $makef $makef_dir 2>/dev/null | \
|
||||
awk -F':' '/^[a-zA-Z0-9][^$#\/\t=]*:([^=]|$)/ \
|
||||
{split($1,A,/ /);for(i in A)print A[i]}' )" \
|
||||
|
@ -16,7 +16,7 @@ _man()
|
||||
COMPREPLY=()
|
||||
cur=`_get_cword`
|
||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
|
||||
|
||||
if [[ "$prev" == -l ]]; then
|
||||
_filedir $manext
|
||||
return 0
|
||||
|
@ -8,7 +8,7 @@ _monodevelop()
|
||||
{
|
||||
local cur
|
||||
cur=`_get_cword`
|
||||
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-? -help \
|
||||
-help2 \
|
||||
@ -33,7 +33,7 @@ _mdtool()
|
||||
|
||||
cur=`_get_cword`
|
||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
|
||||
|
||||
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
|
||||
if [[ ${COMP_WORDS[i]} == @(build|generate-makefiles|setup) ]]; then
|
||||
command=${COMP_WORDS[i]}
|
||||
@ -87,11 +87,11 @@ _mdtool()
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
||||
COMPREPLY=( $( compgen -W 'gsetup build dbgen project-export \
|
||||
generate-makefiles gettext-update \
|
||||
setup -q' -- "$cur" ) )
|
||||
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _mdtool $filenames mdtool
|
||||
|
@ -7,7 +7,7 @@ have mtx &&
|
||||
_mtx()
|
||||
{
|
||||
local cur prev options tapes drives
|
||||
|
||||
|
||||
COMPREPLY=()
|
||||
cur=`_get_cword`
|
||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
@ -25,9 +25,9 @@ _mtx()
|
||||
drives=${drives//:Empty}
|
||||
|
||||
if [ $COMP_CWORD -gt 1 ]; then
|
||||
case $prev in
|
||||
load)
|
||||
COMPREPLY=( $( compgen -W "$tapes" -- $cur ) )
|
||||
case $prev in
|
||||
load)
|
||||
COMPREPLY=( $( compgen -W "$tapes" -- $cur ) )
|
||||
;;
|
||||
unload|first|last|next)
|
||||
COMPREPLY=( $( compgen -W "$drives" -- $cur ) )
|
||||
|
@ -209,7 +209,7 @@ _openssl()
|
||||
-no_tls1 -bugs -cipher \
|
||||
-starttls -engine -tlsextdebug \
|
||||
-no_ticket -sess_out -sess_in \
|
||||
-rand'
|
||||
-rand'
|
||||
;;
|
||||
s_server)
|
||||
options='-accept -context -verify \
|
||||
|
@ -7,7 +7,7 @@ have qdbus &&
|
||||
_qdbus()
|
||||
{
|
||||
local cur compstr
|
||||
|
||||
|
||||
COMPREPLY=()
|
||||
cur=`_get_cword`
|
||||
if [ -z "$cur" ]; then
|
||||
|
@ -59,7 +59,7 @@ _ri()
|
||||
method=${cur#*$separator}
|
||||
classes=( $class )
|
||||
prefix="-P $class$separator"
|
||||
ri_get_methods
|
||||
ri_get_methods
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
@ -33,7 +33,7 @@ _rpm_nodigsig()
|
||||
{
|
||||
if [ -z "$nodig" -a -z "$nosig" ]; then
|
||||
local rpmver
|
||||
|
||||
|
||||
rpmver=$(rpm --version)
|
||||
rpmver=${rpmver##* }
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
# bash completion for strace
|
||||
|
||||
have strace &&
|
||||
have strace &&
|
||||
_strace()
|
||||
{
|
||||
local cur prev offset i syscalls arch unistd
|
||||
@ -38,7 +38,7 @@ _strace()
|
||||
if [[ "$cur" == *=* ]]; then
|
||||
prev=${cur/=*/}
|
||||
cur=${cur/*=/}
|
||||
|
||||
|
||||
# Import arch-specific syscalls -- not foolproof IMHO
|
||||
#+ --David Paleino
|
||||
arch=$(command uname -m)
|
||||
|
@ -4,7 +4,7 @@
|
||||
# unace(1) completion by Guillaume Rousse <rousse@ccr.jussieu.fr>
|
||||
|
||||
have unace &&
|
||||
_unace()
|
||||
_unace()
|
||||
{
|
||||
local cur
|
||||
|
||||
@ -23,7 +23,7 @@ _unace()
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
return 0
|
||||
|
||||
} &&
|
||||
|
@ -4,7 +4,7 @@
|
||||
# unrar(1) completion by Guillaume Rousse <rousse@ccr.jussieu.fr>
|
||||
|
||||
have unrar &&
|
||||
_unrar()
|
||||
_unrar()
|
||||
{
|
||||
local cur
|
||||
|
||||
@ -25,7 +25,7 @@ _unrar()
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _unrar $filenames unrar
|
||||
|
@ -7,7 +7,7 @@ have vncviewer &&
|
||||
_vncviewer_bootstrap() {
|
||||
local fname
|
||||
case "$(_realcommand vncviewer)" in
|
||||
# If `vncviewer' not installed, default file-dir completion
|
||||
# If `vncviewer' not installed, default file-dir completion
|
||||
'') _filedir `_get_cword` ;;
|
||||
*xvnc4viewer) fname=_xvnc4viewer ;;
|
||||
*tightvncviewer|*) fname=_tightvncviewer ;;
|
||||
@ -117,7 +117,7 @@ _xvnc4viewer()
|
||||
# Variable 'nocasematch' isn't available;
|
||||
# Convert completions to lowercase
|
||||
COMPREPLY=( $( compgen -W "$(
|
||||
echo ${options[@]/#/$dash} | tr [:upper:] [:lower:]
|
||||
echo ${options[@]/#/$dash} | tr [:upper:] [:lower:]
|
||||
)" -- "$(echo "$cur" | tr [:upper:] [:lower:])" ) )
|
||||
fi
|
||||
else
|
||||
|
@ -19,7 +19,7 @@ _vpnc()
|
||||
return 0
|
||||
;;
|
||||
--pfs)
|
||||
COMPREPLY=( $( compgen -W 'dh1 dh2 dh5' -- $cur ) )
|
||||
COMPREPLY=( $( compgen -W 'dh1 dh2 dh5' -- $cur ) )
|
||||
return 0
|
||||
;;
|
||||
--@(pid-file|script))
|
||||
|
@ -32,7 +32,7 @@ _xm()
|
||||
vtpm-list vnet-list vnet-create vnet-delete labels addlabel \
|
||||
rmlabel getlabel dry-run resources makepolicy loadpolicy \
|
||||
cfgbootpolicy dumppolicy help'
|
||||
|
||||
|
||||
if [[ $COMP_CWORD -eq 1 ]] ; then
|
||||
COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user