Extract process name completion from _killall to _pnames, make it work for others than Linux and FreeBSD.
This commit is contained in:
parent
645aac4790
commit
c492f00705
@ -428,6 +428,31 @@ _pgids()
|
|||||||
COMPREPLY=( $( compgen -W '$( command ps axo pgid | sed 1d )' -- $cur ))
|
COMPREPLY=( $( compgen -W '$( command ps axo pgid | sed 1d )' -- $cur ))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# This function completes on process names.
|
||||||
|
# AIX and SunOS prefer X/Open, all else should be BSD.
|
||||||
|
[ $UNAME = SunOS -o $UNAME = AIX ] &&
|
||||||
|
_pnames()
|
||||||
|
{
|
||||||
|
COMPREPLY=( $( compgen -W '$( command ps -efo comm | \
|
||||||
|
sed -e 1d -e "s:.*/::" -e "s/^-//" \
|
||||||
|
-e "s/^<defunct>$//")' \
|
||||||
|
-- $cur ) )
|
||||||
|
} ||
|
||||||
|
_pnames()
|
||||||
|
{
|
||||||
|
# FIXME: completes "[kblockd/0]" to "0". Previously it was completed
|
||||||
|
# to "kblockd" which isn't correct either. "kblockd/0" would be
|
||||||
|
# arguably most correct, but killall from psmisc 22 treats arguments
|
||||||
|
# containing "/" specially unless -r is given so that wouldn't quite
|
||||||
|
# work either. Perhaps it'd be best to not complete these to anything
|
||||||
|
# for now.
|
||||||
|
COMPREPLY=( $( compgen -W '$( command ps axo command | \
|
||||||
|
sed -e "1d; s/ .*//; s:.*/::; s/:$//;" \
|
||||||
|
-e "s/^[[(-]//; s/[])]$//" \
|
||||||
|
-e "s/^<defunct>$//")' \
|
||||||
|
-- $cur ) )
|
||||||
|
}
|
||||||
|
|
||||||
# This function completes on user IDs
|
# This function completes on user IDs
|
||||||
#
|
#
|
||||||
_uids()
|
_uids()
|
||||||
@ -1028,17 +1053,7 @@ _killall()
|
|||||||
if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then
|
if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then
|
||||||
_signals
|
_signals
|
||||||
else
|
else
|
||||||
# FIXME: completes "[kblockd/0]" to "0". Previously it was
|
_pnames
|
||||||
# completed to "kblockd" which isn't correct either.
|
|
||||||
# "kblockd/0" would be arguably most correct, but killall from
|
|
||||||
# psmisc 22 treats arguments containing "/" specially unless
|
|
||||||
# -r is given so that wouldn't quite work either. Perhaps it'd
|
|
||||||
# be best to not complete these to anything for now.
|
|
||||||
COMPREPLY=( $( compgen -W '$( command ps axo command | \
|
|
||||||
sed -e "1d; s/ .*//; s:.*/::; s/:$//;" \
|
|
||||||
-e "s/^[[(-]//; s/[])]$//" \
|
|
||||||
-e "s/^<defunct>$//")' \
|
|
||||||
-- $cur ) )
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
4
debian/changelog
vendored
4
debian/changelog
vendored
@ -122,7 +122,9 @@ bash-completion (200902xx) UNRELEASED; urgency=low
|
|||||||
* Fix awk error in "modprobe -r /" completion (Closes: #512556).
|
* Fix awk error in "modprobe -r /" completion (Closes: #512556).
|
||||||
* Expand ~foo to dir name more eagerly to avoid quoting issues.
|
* Expand ~foo to dir name more eagerly to avoid quoting issues.
|
||||||
* Fix -sourcepath handling in javadoc packages completion.
|
* Fix -sourcepath handling in javadoc packages completion.
|
||||||
* Fix killall completion for commands with relative paths (RHBZ: #484578).
|
* Extract process name completion from _killall to _pnames, make it work
|
||||||
|
for others than Linux and FreeBSD.
|
||||||
|
* Fix process name completion with relative paths (RHBZ: #484578).
|
||||||
|
|
||||||
[ 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