Indentation/linewrap fixes.

This commit is contained in:
Ville Skyttä 2009-11-04 00:24:28 +02:00
parent 41c675e749
commit db7d2833df

View File

@ -451,11 +451,8 @@ _split_longopt()
_parse_help() { _parse_help() {
local cmd local cmd
cmd=$1 cmd=$1
$cmd --help | \ $cmd --help | grep -- "^[[:space:]]*-" | tr "," " " | \
grep -- "^[[:space:]]*-" | \ awk '{print $1; if ($2 ~ /-.*/) { print $2 } }' | sed -e "s:=.*::g"
tr "," " " | \
awk '{print $1; if ($2 ~ /-.*/) { print $2 } }' | \
sed -e "s:=.*::g"
} }
# This function completes on signal names # This function completes on signal names
@ -579,9 +576,7 @@ _pgids()
_pnames() _pnames()
{ {
COMPREPLY=( $( compgen -W '$( command ps -efo comm | \ COMPREPLY=( $( compgen -W '$( command ps -efo comm | \
sed -e 1d -e "s:.*/::" -e "s/^-//" \ sed -e 1d -e "s:.*/::" -e "s/^-//" -e "s/^<defunct>$//")' -- "$cur" ) )
-e "s/^<defunct>$//")' \
-- "$cur" ) )
} || } ||
_pnames() _pnames()
{ {
@ -594,10 +589,8 @@ _pnames()
# Not using "ps axo comm" because under some Linux kernels, it # Not using "ps axo comm" because under some Linux kernels, it
# truncates command names (see e.g. http://bugs.debian.org/497540#19) # truncates command names (see e.g. http://bugs.debian.org/497540#19)
COMPREPLY=( $( compgen -W '$( command ps axo command= | \ COMPREPLY=( $( compgen -W '$( command ps axo command= | \
sed -e "s/ .*//" -e "s:.*/::" -e "s/:$//" \ sed -e "s/ .*//" -e "s:.*/::" -e "s/:$//" -e "s/^[[(-]//" \
-e "s/^[[(-]//" -e "s/[])]$//" \ -e "s/[])]$//" -e "s/^<defunct>$//")' -- "$cur" ) )
-e "s/^<defunct>$//")' \
-- "$cur" ) )
} }
# This function completes on user IDs # This function completes on user IDs
@ -684,7 +677,7 @@ _usergroup()
_shells() _shells()
{ {
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W '$( grep "^[[:space:]]*/" \ COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W '$( grep "^[[:space:]]*/" \
/etc/shells 2>/dev/null )' -- "$cur" ) ) /etc/shells 2>/dev/null )' -- "$cur" ) )
} }
# Get real command. # Get real command.
@ -723,7 +716,7 @@ _count_args()
_pci_ids() _pci_ids()
{ {
COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W \ COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W \
"$( PATH="$PATH:/sbin" lspci -n | awk '{print $3}')" -- "$cur" ) ) "$( PATH="$PATH:/sbin" lspci -n | awk '{print $3}')" -- "$cur" ) )
} }
# This function completes on USB IDs # This function completes on USB IDs
@ -731,15 +724,15 @@ _pci_ids()
_usb_ids() _usb_ids()
{ {
COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W \ COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W \
"$( PATH="$PATH:/sbin" lsusb | awk '{print $6}' )" -- "$cur" ) ) "$( PATH="$PATH:/sbin" lsusb | awk '{print $6}' )" -- "$cur" ) )
} }
# start of section containing completion functions for external programs # start of section containing completion functions for external programs
# a little help for FreeBSD ports users # a little help for FreeBSD ports users
[ $UNAME = FreeBSD ] && complete -W 'index search fetch fetch-list \ [ $UNAME = FreeBSD ] && complete -W 'index search fetch fetch-list extract \
extract patch configure build install reinstall \ patch configure build install reinstall deinstall clean clean-depends \
deinstall clean clean-depends kernel buildworld' make kernel buildworld' make
# This completes on a list of all available service scripts for the # This completes on a list of all available service scripts for the
# 'service' command and/or the SysV init.d directory, followed by # 'service' command and/or the SysV init.d directory, followed by
@ -761,22 +754,21 @@ _service()
# don't complete past 2nd token # don't complete past 2nd token
[ $COMP_CWORD -gt 2 ] && return 0 [ $COMP_CWORD -gt 2 ] && return 0
[ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d \ [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d
|| sysvdir=/etc/init.d
if [[ $COMP_CWORD -eq 1 ]] && [[ $prev == "service" ]]; then if [[ $COMP_CWORD -eq 1 ]] && [[ $prev == "service" ]]; then
_services _services
else else
COMPREPLY=( $( compgen -W '`sed -e "y/|/ /" \ COMPREPLY=( $( compgen -W '`sed -e "y/|/ /" \
-ne "s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\2/p" \ -ne "s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\2/p" \
$sysvdir/${prev##*/} 2>/dev/null`' -- "$cur" ) ) $sysvdir/${prev##*/} 2>/dev/null`' -- "$cur" ) )
fi fi
return 0 return 0
} && } &&
complete -F _service service complete -F _service service
[ -d /etc/init.d/ ] && complete -F _service -o default \ [ -d /etc/init.d/ ] && complete -F _service -o default \
$(for i in /etc/init.d/*; do echo ${i##*/}; done) $(for i in /etc/init.d/*; do echo ${i##*/}; done)
# chown(1) completion # chown(1) completion
@ -804,9 +796,9 @@ _chown()
# options completion # options completion
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes \ COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes --dereference \
--dereference --no-dereference --from --silent --quiet \ --no-dereference --from --silent --quiet --reference --recursive \
--reference --recursive --verbose --help --version' -- "$cur" ) ) --verbose --help --version' -- "$cur" ) )
else else
_count_args _count_args
@ -845,9 +837,9 @@ _chgrp()
# options completion # options completion
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes \ COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes --dereference \
--dereference --no-dereference --silent --quiet \ --no-dereference --silent --quiet --reference --recursive \
--reference --recursive --verbose --help --version' -- "$cur" ) ) --verbose --help --version' -- "$cur" ) )
return 0 return 0
fi fi
@ -1113,10 +1105,9 @@ _ipsec()
if [ $COMP_CWORD -eq 1 ]; then if [ $COMP_CWORD -eq 1 ]; then
COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look \ COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look manual \
manual pluto ranbits rsasigkey \ pluto ranbits rsasigkey setup showdefaults showhostkey spi spigrp \
setup showdefaults showhostkey spi \ tncfg whack' -- "$cur" ) )
spigrp tncfg whack' -- "$cur" ) )
return 0 return 0
fi fi
@ -1345,8 +1336,9 @@ _known_hosts_real()
return 0 return 0
} # _known_hosts_real() } # _known_hosts_real()
complete -F _known_hosts traceroute traceroute6 tracepath tracepath6 \ complete -F _known_hosts traceroute traceroute6 tracepath tracepath6 ping \
ping ping6 fping fping6 telnet host nslookup rsh rlogin ftp dig ssh-installkeys mtr ping6 fping fping6 telnet host nslookup rsh rlogin ftp dig mtr \
ssh-installkeys
# This meta-cd function observes the CDPATH variable, so that cd additionally # This meta-cd function observes the CDPATH variable, so that cd additionally
# completes on directories under those specified in CDPATH. # completes on directories under those specified in CDPATH.
@ -1427,7 +1419,7 @@ _command()
_command_offset() _command_offset()
{ {
local cur func cline cspec noglob cmd i char_offset word_offset \ local cur func cline cspec noglob cmd i char_offset word_offset \
_COMMAND_FUNC _COMMAND_FUNC_ARGS _COMMAND_FUNC _COMMAND_FUNC_ARGS
word_offset=$1 word_offset=$1