mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 06:56:09 +08:00
Stringify make_completion_signals
This commit is contained in:
parent
acefa61e8b
commit
1480865d52
@ -30,16 +30,13 @@ function __fish_make_completion_signals --description 'Make list of kill signals
|
||||
# Posix systems print out the name of a signal using 'kill -l SIGNUM'.
|
||||
complete -c kill -s l --description "List names of available signals"
|
||||
for i in (seq 31)
|
||||
set -a __kill_signals $i" "(kill -l $i | tr '[:lower:]' '[:upper:]')
|
||||
set -a __kill_signals $i" "(kill -l $i | string upper)
|
||||
end
|
||||
else
|
||||
# Debian and some related systems use 'kill -L' to write out a numbered list
|
||||
# util-linux (on Arch) and procps-ng (on Debian) kill use 'kill -L' to write out a numbered list
|
||||
# of signals. Use this to complete on both number _and_ on signal name.
|
||||
complete -c kill -s L --description "List codes and names of available signals"
|
||||
kill -L | sed -e 's/^ //; s/ */ /g; y/ /\n/' | while read -l signo
|
||||
test -z "$signo"
|
||||
and break # the sed above produces one blank line at the end
|
||||
read -l signame
|
||||
kill -L | string trim | string replace -ra ' *' \n | while read -l signo signame
|
||||
set -a __kill_signals "$signo $signame"
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user