Split killall, pkill, pgrep and related completions into contrib/procps.
This commit is contained in:
parent
77af9f50d3
commit
3f1f6120d7
1
CHANGES
1
CHANGES
@ -59,6 +59,7 @@ bash-completion (2.x)
|
||||
* Split service completion into contrib/service.
|
||||
* Split chown, chgrp, and id completions into contrib/coreutils.
|
||||
* Split kill, look, and renice completions into contrib/util-linux.
|
||||
* Split killall, pkill, pgrep and related completions into contrib/procps.
|
||||
* Do basic HTML file completion with Firefox and Chrome and friends,
|
||||
and Epiphany.
|
||||
* Do basic diff/patch completion with cdiff and kompare.
|
||||
|
@ -110,6 +110,7 @@ bashcomp_DATA = contrib/abook \
|
||||
contrib/postfix \
|
||||
contrib/postgresql \
|
||||
contrib/povray \
|
||||
contrib/procps \
|
||||
contrib/python \
|
||||
contrib/qdbus \
|
||||
contrib/qemu \
|
||||
|
@ -1081,45 +1081,6 @@ _dvd_devices()
|
||||
[ $UNAME = FreeBSD ] && complete -W 'index search fetch fetch-list extract \
|
||||
patch configure build install reinstall deinstall clean clean-depends \
|
||||
kernel buildworld' make
|
||||
# killall(1) (Linux and FreeBSD) and pkill(1) completion.
|
||||
#
|
||||
[[ $UNAME == Linux || $UNAME == FreeBSD ]] || have pkill &&
|
||||
_killall()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
cur=`_get_cword`
|
||||
|
||||
if [[ $COMP_CWORD -eq 1 && "$cur" == -* ]]; then
|
||||
_signals
|
||||
else
|
||||
_pnames
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
[[ $UNAME == Linux || $UNAME == FreeBSD ]] && complete -F _killall killall
|
||||
have pkill && complete -F _killall pkill
|
||||
|
||||
# pgrep(1) completion.
|
||||
#
|
||||
[ $UNAME = Linux ] || have pgrep &&
|
||||
_pgrep()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
cur=`_get_cword`
|
||||
|
||||
_pnames
|
||||
|
||||
return 0
|
||||
}
|
||||
have pgrep && complete -F _pgrep pgrep
|
||||
|
||||
# Linux pidof(8) completion.
|
||||
[ $UNAME = Linux ] && complete -F _pgrep pidof
|
||||
|
||||
# Red Hat & Debian GNU/Linux if{up,down} completion
|
||||
#
|
||||
|
49
contrib/procps
Normal file
49
contrib/procps
Normal file
@ -0,0 +1,49 @@
|
||||
# Completions for tools included in procps and related
|
||||
|
||||
# killall(1) (Linux and FreeBSD) and pkill(1) completion.
|
||||
#
|
||||
[[ $UNAME == Linux || $UNAME == FreeBSD ]] || have pkill &&
|
||||
_killall()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
cur=`_get_cword`
|
||||
|
||||
if [[ $COMP_CWORD -eq 1 && "$cur" == -* ]]; then
|
||||
_signals
|
||||
else
|
||||
_pnames
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
[[ $UNAME == Linux || $UNAME == FreeBSD ]] && complete -F _killall killall
|
||||
have pkill && complete -F _killall pkill
|
||||
|
||||
# pgrep(1) completion.
|
||||
#
|
||||
[ $UNAME = Linux ] || have pgrep &&
|
||||
_pgrep()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
cur=`_get_cword`
|
||||
|
||||
_pnames
|
||||
|
||||
return 0
|
||||
}
|
||||
have pgrep && complete -F _pgrep pgrep
|
||||
|
||||
# Linux pidof(8) completion.
|
||||
[ $UNAME = Linux ] && complete -F _pgrep pidof
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
# sh-basic-offset: 4
|
||||
# sh-indent-comment: t
|
||||
# indent-tabs-mode: nil
|
||||
# End:
|
||||
# ex: ts=4 sw=4 et filetype=sh
|
1
test/completion/pgrep.exp
Normal file
1
test/completion/pgrep.exp
Normal file
@ -0,0 +1 @@
|
||||
assert_source_completions pgrep
|
1
test/completion/pkill.exp
Normal file
1
test/completion/pkill.exp
Normal file
@ -0,0 +1 @@
|
||||
assert_source_completions pkill
|
20
test/lib/completions/pgrep.exp
Normal file
20
test/lib/completions/pgrep.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "pgrep "
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
20
test/lib/completions/pkill.exp
Normal file
20
test/lib/completions/pkill.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "pkill "
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
Loading…
x
Reference in New Issue
Block a user