Skip to content

Commit

Permalink
*: remove whitespace after redirections
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Apr 14, 2019
1 parent 90e380b commit 689beea
Show file tree
Hide file tree
Showing 22 changed files with 54 additions and 54 deletions.
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ EXTRA_DIST = CHANGES $(pkgdata_DATA) bash_completion.sh.in .dir-locals.el \
install-data-hook:
tmpfile=`mktemp $${TMPDIR:-/tmp}/bash_completion.XXXXXX` && \
$(SED) -e 's|-/etc/bash_completion\.d|-$(compatdir)|' \
$(DESTDIR)$(pkgdatadir)/bash_completion > $$tmpfile && \
cat $$tmpfile > $(DESTDIR)$(pkgdatadir)/bash_completion && \
$(DESTDIR)$(pkgdatadir)/bash_completion >$$tmpfile && \
cat $$tmpfile >$(DESTDIR)$(pkgdatadir)/bash_completion && \
rm $$tmpfile
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ A. Probably because the database is being queried every time and this uses a
#!/bin/sh

rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n' 2>&1 \
| sort > /var/log/rpmpkgs
| sort >/var/log/rpmpkgs
```

rpm completion will use this flat text file instead of the RPM database,
Expand Down
16 changes: 8 additions & 8 deletions bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ quote_readline()
# This function shell-dequotes the argument
dequote()
{
eval printf %s "$1" 2> /dev/null
eval printf %s "$1" 2>/dev/null
}


Expand Down Expand Up @@ -192,7 +192,7 @@ _upvars()
# Error checking
[[ ${1#-a} ]] || { echo "bash: ${FUNCNAME[0]}: \`$1': missing"\
"number specifier" 1>&2; return 1; }
printf %d "${1#-a}" &> /dev/null || { echo "bash:"\
printf %d "${1#-a}" &>/dev/null || { echo "bash:"\
"${FUNCNAME[0]}: \`$1': invalid number specifier" 1>&2
return 1; }
# Assign array of -aN elements
Expand Down Expand Up @@ -1288,7 +1288,7 @@ _shells()
local shell rest
while read -r shell rest; do
[[ $shell == /* && $shell == "$cur"* ]] && COMPREPLY+=( $shell )
done 2>/dev/null < /etc/shells
done 2>/dev/null </etc/shells
}

# This function completes on valid filesystem types
Expand Down Expand Up @@ -1320,12 +1320,12 @@ _fstypes()
# - return: True (0) if command found, False (> 0) if not.
_realcommand()
{
type -P "$1" > /dev/null && {
if type -p realpath > /dev/null; then
type -P "$1" >/dev/null && {
if type -p realpath >/dev/null; then
realpath "$(type -P "$1")"
elif type -p greadlink > /dev/null; then
elif type -p greadlink >/dev/null; then
greadlink -f "$(type -P "$1")"
elif type -p readlink > /dev/null; then
elif type -p readlink >/dev/null; then
readlink -f "$(type -P "$1")"
else
type -P "$1"
Expand Down Expand Up @@ -1592,7 +1592,7 @@ _known_hosts_real()
COMPREPLY+=( $host )
done
IFS=$OIFS
done < "$i"
done <"$i"
done
COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") )
fi
Expand Down
4 changes: 2 additions & 2 deletions completions/7z
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ _7z()
x=$(compgen -P"${opt}${cur%%@*}@" -f -- "${cur#*@}") &&
while read -r tmp; do
COMPREPLY+=( "$tmp" )
done <<< "$x"
done <<<"$x"
compopt -o filenames
fi
return
Expand All @@ -51,7 +51,7 @@ _7z()
x=$(compgen -P${cur:0:2} -S/ -d -- "${cur:2}") &&
while read -r tmp; do
COMPREPLY+=( "$tmp" )
done <<< "$x"
done <<<"$x"
compopt -o nospace -o filenames
return
;;
Expand Down
8 changes: 4 additions & 4 deletions completions/_umount.linux
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ _linux_fstab()
if [[ $cur && $cur != /* ]]; then
local realcur
[[ $cur == */ ]] && # don't let readlink drop last / from path
realcur="$(readlink -f "$cur." 2> /dev/null)/" ||
realcur=$(readlink -f "$cur" 2> /dev/null)
realcur="$(readlink -f "$cur." 2>/dev/null)/" ||
realcur=$(readlink -f "$cur" 2>/dev/null)
if [[ $realcur ]]; then
local dirrealcur= dircur= basecur
if [[ $cur == */* ]]; then
Expand All @@ -84,7 +84,7 @@ _linux_fstab()
local i n=${#COMPREPLY[@]}
for (( i=0; i < $n; i++ )); do
[[ "${COMPREPLY[i]}" == "$realcur"* ]] &&
COMPREPLY+=( $(cd "$dircur" 2> /dev/null &&
COMPREPLY+=( $(cd "$dircur" 2>/dev/null &&
compgen -f -d -P "$dircur" \
-X "!${COMPREPLY[i]##"$dirrealcur"}" -- "$basecur") )
done
Expand Down Expand Up @@ -132,7 +132,7 @@ _umount()
if [[ -r /proc/mounts ]]; then
# Linux /proc/mounts is properly quoted. This is important when
# unmounting usb devices with pretty names.
_linux_fstab < /proc/mounts
_linux_fstab </proc/mounts
else
local IFS=$'\n'
COMPREPLY=( $(compgen -W '$(mount | cut -d" " -f 3)' -- "$cur") )
Expand Down
4 changes: 2 additions & 2 deletions completions/ant
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ _ant_parse_targets()
if [[ $line =~ \<(target|extension-point)[[:space:]].*name=[\"\']([^\"\']+) ]]; then
targets+=" ${BASH_REMATCH[2]}"
fi
done < $1
done <$1

# parse imports
while read -rd '>' line; do
Expand All @@ -22,7 +22,7 @@ _ant_parse_targets()
_ant_parse_targets $imported_buildfile
fi
fi
done < $1
done <$1
}

_ant()
Expand Down
2 changes: 1 addition & 1 deletion completions/apt-build
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ _apt_build()
if [[ -n $special ]]; then
case $special in
install|source|info)
COMPREPLY=( $(apt-cache pkgnames "$cur" 2> /dev/null) )
COMPREPLY=( $(apt-cache pkgnames "$cur" 2>/dev/null) )
;;
remove)
COMPREPLY=( \
Expand Down
2 changes: 1 addition & 1 deletion completions/apt-cache
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# List APT binary packages
_apt_cache_packages() {
apt-cache --no-generate pkgnames "$cur" 2> /dev/null
apt-cache --no-generate pkgnames "$cur" 2>/dev/null
}

# List APT source packages
Expand Down
2 changes: 1 addition & 1 deletion completions/apt-get
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ _apt_get()
;;
source)
COMPREPLY=( $(apt-cache --no-generate pkgnames "$cur" \
2> /dev/null) $(apt-cache dumpavail | \
2>/dev/null) $(apt-cache dumpavail | \
command grep "^Source: $cur" | sort -u | cut -f2 -d" ") )
;;
install)
Expand Down
2 changes: 1 addition & 1 deletion completions/aptitude
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ _aptitude()
--target-release|--default-release|-!(-*)t)
COMPREPLY=( $(apt-cache policy | \
command grep "release.o=Debian,a=$cur" | \
command sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null) )
command sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2>/dev/null) )
return
;;
esac
Expand Down
4 changes: 2 additions & 2 deletions completions/cvs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ _cvs_roots()
local -a cvsroots
cvsroots=( $CVSROOT )
[[ -r ~/.cvspass ]] && cvsroots+=( $(awk '{ print $2 }' ~/.cvspass) )
[[ -r CVS/Root ]] && mapfile -tO ${#cvsroots[@]} cvsroots < CVS/Root
[[ -r CVS/Root ]] && mapfile -tO ${#cvsroots[@]} cvsroots <CVS/Root
COMPREPLY=( $(compgen -W '${cvsroots[@]}' -- "$cur") )
__ltrim_colon_completions "$cur"
}
Expand Down Expand Up @@ -224,7 +224,7 @@ _cvs()

if [[ "$cur" != -* ]]; then
[[ -z $cvsroot ]] && cvsroot=$CVSROOT
COMPREPLY=( $(cvs -d "$cvsroot" co -c 2> /dev/null | \
COMPREPLY=( $(cvs -d "$cvsroot" co -c 2>/dev/null | \
awk '{print $1}') )
COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") )
else
Expand Down
2 changes: 1 addition & 1 deletion completions/fbgs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ _fbgs()
-m|--mode)
COMPREPLY=( $(compgen -W '$(command sed \
-n "/^mode/{s/^mode \{1,\}\"\([^\"]\{1,\}\)\"/\1/g;p}" \
/etc/fb.modes 2> /dev/null)' -- "$cur") )
/etc/fb.modes 2>/dev/null)' -- "$cur") )
return
;;
-d|--device)
Expand Down
4 changes: 2 additions & 2 deletions completions/fbi
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ _fbi()
;;
-f|--font)
local IFS=$'\n'
COMPREPLY=( $(compgen -W '$(fc-list 2> /dev/null)' -- "$cur") )
COMPREPLY=( $(compgen -W '$(fc-list 2>/dev/null)' -- "$cur") )
return
;;
-m|--mode)
COMPREPLY=( $(compgen -W '$(command sed \
-n "/^mode/{s/^mode \{1,\}\"\([^\"]\{1,\}\)\"/\1/g;p}" \
/etc/fb.modes 2> /dev/null)' -- "$cur") )
/etc/fb.modes 2>/dev/null)' -- "$cur") )
return
;;
-d|--device)
Expand Down
8 changes: 4 additions & 4 deletions completions/feh
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ _feh()
return
fi
local font_path
# font_path="$(imlib2-config --prefix 2> /dev/null)/share/imlib2/data/fonts"
# COMPREPLY=( $(cd "$font_path" 2> /dev/null; compgen -f \
# font_path="$(imlib2-config --prefix 2>/dev/null)/share/imlib2/data/fonts"
# COMPREPLY=( $(cd "$font_path" 2>/dev/null; compgen -f \
# -X "!*.@([tT][tT][fF])" -S / -- "$cur") )
for (( i=${#words[@]}-1; i>0; i-- )); do
if [[ ${words[i]} == -@(C|-fontpath) ]]; then
font_path="${words[i+1]}"
COMPREPLY+=( $(cd "$font_path" 2> /dev/null; compgen -f \
COMPREPLY+=( $(cd "$font_path" 2>/dev/null; compgen -f \
-X "!*.@([tT][tT][fF])" -S / -- "$cur") )
fi
done
Expand All @@ -48,7 +48,7 @@ _feh()
continue
fi
COMPREPLY+=( $(compgen -W "$theme_name" -- "$cur") )
done < "$conf_path"
done <"$conf_path"
return
;;
--sort|-!(-*)S)
Expand Down
2 changes: 1 addition & 1 deletion completions/ipsec
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ _ipsec_strongswan()
case ${words[1]} in
down|route|status|statusall|unroute|up)
local confdir=$(ipsec --confdir)
_ipsec_connections < "$confdir/ipsec.conf"
_ipsec_connections <"$confdir/ipsec.conf"
;;
list*)
COMPREPLY=( $(compgen -W '--utc' -- "$cur") )
Expand Down
4 changes: 2 additions & 2 deletions completions/portinstall
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ _portinstall()

[[ "$prev" == -l || "$prev" == -L || "$prev" == -o ]] && return

COMPREPLY=( $(command grep -E "^$cur" 2>/dev/null < $indexfile | \
COMPREPLY=( $(command grep -E "^$cur" 2>/dev/null <$indexfile | \
cut -d'|' -f1) )
COMPREPLY2=( $(command grep -E "^[^\|]+\|$portsdir$cur" 2>/dev/null \
< $indexfile | cut -d'|' -f2) )
<$indexfile | cut -d'|' -f2) )
COMPREPLY2=( ${COMPREPLY2[@]#$portsdir} )
COMPREPLY+=( "${COMPREPLY2[@]}" )

Expand Down
2 changes: 1 addition & 1 deletion completions/removepkg
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ _removepkg()
fi

local root=${ROOT:-/}
COMPREPLY=( $(cd "$root/var/log/packages" 2> /dev/null || return 1; \
COMPREPLY=( $(cd "$root/var/log/packages" 2>/dev/null || return 1; \
compgen -f -- "$cur") )
} &&
complete -F _removepkg removepkg
Expand Down
4 changes: 2 additions & 2 deletions completions/slackpkg
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ _slackpkg()
_filedir
COMPREPLY+=( $(compgen -W 'a ap d e f k kde kdei l n t tcl x
xap xfce y' -- "$cur") )
COMPREPLY+=( $(cut -f 6 -d\ "${WORKDIR}/pkglist" 2> /dev/null | \
COMPREPLY+=( $(cut -f 6 -d\ "${WORKDIR}/pkglist" 2>/dev/null | \
command grep "^$cur") )
return
;;
info)
COMPREPLY=( $(cut -f 6 -d\ "${WORKDIR}/pkglist" 2> /dev/null | \
COMPREPLY=( $(cut -f 6 -d\ "${WORKDIR}/pkglist" 2>/dev/null | \
command grep "^$cur") )
return
;;
Expand Down
8 changes: 4 additions & 4 deletions completions/slapt-get
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ _slapt_get()
# slapt-get will fail to search for "^name-version"
# it can search for names only
local name=${cur%%-*}
COMPREPLY=( $(LC_ALL=C "$1" -c "$config" --search "^$name" 2> \
/dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}") )
COMPREPLY=( $(LC_ALL=C "$1" -c "$config" --search "^$name" \
2>/dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}") )
return
;;
avl) # --install|-i|
COMPREPLY=( $(LC_ALL=C "$1" -c "$config" --available 2> \
/dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}") )
COMPREPLY=( $(LC_ALL=C "$1" -c "$config" --available \
2>/dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}") )
return
;;
ins) # --remove|--filelist
Expand Down
8 changes: 4 additions & 4 deletions completions/slapt-src
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ _slapt_src()
if [[ "$cur" == *:* ]]; then
local name=${cur%:*}
local version=${cur##*:}
COMPREPLY=( $(LC_ALL=C "$1" --config "$config" --search "^$name" 2> \
/dev/null | LC_ALL=C command sed -ne \
COMPREPLY=( $(LC_ALL=C "$1" --config "$config" --search "^$name" \
2>/dev/null | LC_ALL=C command sed -ne \
"/^$cur/{s/^$name:\([^ ]*\) .*$/\1/;p}") )
else
COMPREPLY=( $(LC_ALL=C "$1" --config "$config" --search "^$cur" 2> \
/dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}") )
COMPREPLY=( $(LC_ALL=C "$1" --config "$config" --search "^$cur" \
2>/dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}") )
fi
} &&
complete -F _slapt_src slapt-src
Expand Down
4 changes: 2 additions & 2 deletions completions/strace
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ _strace()
[[ $define == "#define" && \
$syscall =~ ^__NR_(.+) ]] && \
syscalls[${BASH_REMATCH[1]}]=1
done 2>/dev/null < /usr/include/asm/unistd.h
done 2>/dev/null </usr/include/asm/unistd.h
if [[ ! $syscalls ]]; then
local unistd arch=$(command uname -m)
if [[ "$arch" == *86 ]]; then
Expand All @@ -53,7 +53,7 @@ _strace()
[[ $define == "#define" && \
$syscall =~ ^__NR_(.+) ]] && \
syscalls[${BASH_REMATCH[1]}]=1
done 2>/dev/null < $unistd
done 2>/dev/null <$unistd
fi

COMPREPLY=( $(compgen -W '${!syscalls[@]} file
Expand Down
12 changes: 6 additions & 6 deletions doc/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ ctrl-alt-Fx to switch the console from /dev/tty1 to tty7. There are many more
/dev/tty* which are not accessed via function keys. To be safe, use a tty
greater than tty7)

----------------------
./runUnit < /dev/tty40
----------------------
---------------------
./runUnit </dev/tty40
---------------------

If the process doesn't run as root (recommended), root will have to change the
owner and permissions of the tty:
Expand All @@ -185,7 +185,7 @@ KERNEL=="tty40", MODE="0666"

To start the test at 01:00, set the crontab to this:
----------------------------
* 1 * * * cd bash-completion/test && ./cron.sh < /dev/tty40
* 1 * * * cd bash-completion/test && ./cron.sh </dev/tty40
----------------------------

Here's an example batch file `cron.sh`, to be put in the bash-completion `test`
Expand All @@ -206,8 +206,8 @@ git pull

# Run tests on bash-4

./runUnit --outdir log/bash-4 --tool_exec /opt/bash-4.3/bin/bash > $LOG || cat $LOG
./runCompletion --outdir log/bash-4 --tool_exec /opt/bash-4.3/bin/bash > $LOG || cat $LOG
./runUnit --outdir log/bash-4 --tool_exec /opt/bash-4.3/bin/bash >$LOG || cat $LOG
./runCompletion --outdir log/bash-4 --tool_exec /opt/bash-4.3/bin/bash >$LOG || cat $LOG

# Clean up log file
[ -f $LOG ] && rm $LOG
Expand Down

0 comments on commit 689beea

Please sign in to comment.