Stringify trap

This commit is contained in:
Fabian Homborg 2016-02-03 23:23:04 +01:00
parent df8c4ce835
commit 962f9914c6

View file

@ -1,11 +1,7 @@
function __trap_translate_signal function __trap_translate_signal
set upper (echo $argv[1]|tr a-z A-Z) set upper (echo $argv[1]|tr a-z A-Z)
if expr $upper : 'SIG.*' >/dev/null string replace -r '^SIG' '' -- $upper
echo $upper | cut -c 4-
else
echo $upper
end
end end
function __trap_switch function __trap_switch
@ -124,7 +120,7 @@ function trap -d 'Perform an action when the shell receives a signal'
if count $opt >/dev/null if count $opt >/dev/null
set names $opt set names $opt
else else
set names (functions -na| __fish_sgrep "^__trap_handler_"|sed -e 's/__trap_handler_//' ) set names (functions -na| string match "__trap_handler_*" | string replace '__trap_handler_' '')
end end
for i in $names for i in $names