mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
Stringify trap
This commit is contained in:
parent
df8c4ce835
commit
962f9914c6
1 changed files with 2 additions and 6 deletions
|
@ -1,11 +1,7 @@
|
|||
|
||||
function __trap_translate_signal
|
||||
set upper (echo $argv[1]|tr a-z A-Z)
|
||||
if expr $upper : 'SIG.*' >/dev/null
|
||||
echo $upper | cut -c 4-
|
||||
else
|
||||
echo $upper
|
||||
end
|
||||
string replace -r '^SIG' '' -- $upper
|
||||
end
|
||||
|
||||
function __trap_switch
|
||||
|
@ -124,7 +120,7 @@ function trap -d 'Perform an action when the shell receives a signal'
|
|||
if count $opt >/dev/null
|
||||
set names $opt
|
||||
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
|
||||
|
||||
for i in $names
|
||||
|
|
Loading…
Reference in a new issue