2017-05-23 11:17:08 +08:00
|
|
|
# On Solaris, `killall` kills all processes. So we don't want to bother providing completion
|
|
|
|
# support on that OS.
|
2017-05-05 05:49:59 +08:00
|
|
|
set -l OS (uname)
|
2020-03-10 02:36:12 +08:00
|
|
|
if test "$OS" = SunOS
|
2017-05-23 11:17:08 +08:00
|
|
|
exit 0
|
|
|
|
end
|
|
|
|
|
|
|
|
__fish_make_completion_signals
|
2011-09-23 16:24:21 +08:00
|
|
|
|
2017-05-23 11:17:08 +08:00
|
|
|
for i in $__kill_signals
|
|
|
|
set -l numname (string split " " -- $i)
|
|
|
|
set -l number $numname[1]
|
|
|
|
set -q numname[2]
|
|
|
|
and set -l name $numname[2]
|
|
|
|
complete -c killall -o $number -d $name
|
2022-01-28 22:59:14 +08:00
|
|
|
complete -c killall -o $name -d $name
|
2017-05-23 11:17:08 +08:00
|
|
|
# The `-s` flag doesn't work in OS X
|
2020-03-10 02:36:12 +08:00
|
|
|
test "$OS" != Darwin
|
2017-05-23 11:17:08 +08:00
|
|
|
and complete -c killall -s s -x -a "$number $name"
|
|
|
|
end
|
2011-09-23 16:24:21 +08:00
|
|
|
|
2022-04-01 11:26:02 +08:00
|
|
|
|
|
|
|
complete -c killall -xa '(__fish_complete_proc | string replace -r -- "^-" "")'
|
2011-09-23 16:24:21 +08:00
|
|
|
|
2018-04-02 04:42:38 +08:00
|
|
|
if killall --version >/dev/null 2>/dev/null # GNU
|
2017-05-23 11:17:08 +08:00
|
|
|
complete -c killall -s e -l exact -d 'Require an exact match for very long names'
|
|
|
|
complete -c killall -s I -l ignore-case -d 'Do case insensitive process name match'
|
2023-02-15 04:16:22 +08:00
|
|
|
complete -c killall -s g -l process-group -d 'Kill the process group to which the process belongs with one signal'
|
2017-05-23 11:17:08 +08:00
|
|
|
complete -c killall -s i -l interactive -d 'Interactively ask for confirmation before killing'
|
|
|
|
complete -c killall -s u -l user -x -a "(__fish_complete_users)" -d 'Kill only processes the specified user owns. Command names are optional'
|
|
|
|
complete -c killall -s w -l wait -d 'Wait for all killed processes to die'
|
|
|
|
complete -c killall -s v -l version -d 'Print version'
|
|
|
|
else # probably BSD
|
2022-01-28 22:59:14 +08:00
|
|
|
complete -c killall -s v -d 'Print what is done'
|
|
|
|
complete -c killall -s e -d 'Use effective UID instead of the real UID for -u'
|
2022-04-01 11:26:02 +08:00
|
|
|
complete -c killall -o help
|
2022-01-28 22:59:14 +08:00
|
|
|
complete -c killall -s l -d 'List names of available signals'
|
|
|
|
complete -c killall -s m -d 'Case sensitive process matching'
|
|
|
|
complete -c killall -s s -d "Simulate, send no signals"
|
|
|
|
complete -c killall -s d -d "Simulate & summarize, send no signals"
|
|
|
|
complete -c killall -s u -x -a "(__fish_complete_users)" -d "kill given user's processes"
|
2022-04-01 11:26:02 +08:00
|
|
|
complete -c killall -s t -xa "(ps a -o tty | sed 1d | uniq)" -d 'Limit to processes on specified TTY'
|
2022-01-28 22:59:14 +08:00
|
|
|
complete -c killall -s c -x -d 'Limit to processes matching pattern'
|
|
|
|
complete -c killall -s z -d "Don't skip zombies"
|
2015-12-17 09:37:01 +08:00
|
|
|
end
|