aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/trap.txt
diff options
context:
space:
mode:
authorGravatar David Adam (zanchey) <zanchey@ucc.gu.uwa.edu.au>2013-05-12 15:56:01 +0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-05-13 01:48:20 -0700
commit1287b9d82382bf22e16edda67eae755f07397f2e (patch)
tree811814b029d65ac11a193e616ca4a71d216dbe0c /doc_src/trap.txt
parent91aab03b90a6b583a3c0ecff5b015c6066d34f28 (diff)
Help cleanup
Large list of changes, including formatting and typos for most commands. More substantive changes have been made to alias, bind, block, break, builtin, case, cd, commandline, count, else, emit, fish_config, funced, function, functions, history, math, mimedb, nextd, not, popd, prevd, pushd, pwd, random, read, set, set_color, switch, test, trap, type, ulimit, umask, and while.
Diffstat (limited to 'doc_src/trap.txt')
-rw-r--r--doc_src/trap.txt43
1 files changed, 25 insertions, 18 deletions
diff --git a/doc_src/trap.txt b/doc_src/trap.txt
index bd44d458..aaaa5b2b 100644
--- a/doc_src/trap.txt
+++ b/doc_src/trap.txt
@@ -5,32 +5,39 @@
\subsection trap-description Description
-Trap is a shellscript wrapper around the fish event delivery
-framework. It exists for backwards compatibility with Posix
-shells. For other uses, it is recommended to define a <a
+\c trap is a wrapper around the fish event delivery
+framework. It exists for backwards compatibility with POSIX
+shells. For other uses, it is recommended to define an <a
href='index.html#event'>event handler</a>.
-- ARG is the command to be executed on signal delivery
-- SIGSPEC is the name of the signal to trap
-- \c -h or \c --help Display help and exit
-- \c -l or \c --list-signals print a list of signal names
-- \c -p or \c --print print all defined signal handlers
+The following parameters are available:
-If ARG and SIGSPEC are both specified, ARG is the command to be
-executed when the signal specified by SIGSPEC is delivered.
+- \c ARG is the command to be executed on signal delivery.
+- \c SIGSPEC is the name of the signal to trap.
+- \c -h or \c --help displays help and exits.
+- \c -l or \c --list-signals prints a list of signal names.
+- \c -p or \c --print prints all defined signal handlers.
-If ARG is absent (and there is a single SIGSPEC) or -, each specified
+If \c ARG and \c SIGSPEC are both specified, \c ARG is the command to be
+executed when the signal specified by \c SIGSPEC is delivered.
+
+If \c ARG is absent (and there is a single SIGSPEC) or -, each specified
signal is reset to its original disposition (the value it had upon
-entrance to the shell). If ARG is the null string the signal
-specified by each SIGSPEC is ignored by the shell and by the commands
+entrance to the shell). If \c ARG is the null string the signal
+specified by each \c SIGSPEC is ignored by the shell and by the commands
it invokes.
-If ARG is not present and -p has been supplied, then the trap commands
-associated with each SIGSPEC are displayed. If no arguments are
-supplied or if only -p is given, trap prints the list of commands
+If \c ARG is not present and \c -p has been supplied, then the trap commands
+associated with each \c SIGSPEC are displayed. If no arguments are
+supplied or if only \c -p is given, \c trap prints the list of commands
associated with each signal.
-Signal names are case insensitive and the SIG prefix is optional.
+Signal names are case insensitive and the \c SIG prefix is optional.
-The return status is 1 if any SIGSPEC is invalid; otherwise trap
+The return status is 1 if any \c SIGSPEC is invalid; otherwise trap
returns 0.
+
+\subsection trap-example Example
+
+<code>trap "status --print-stack-trace" SIGUSR1</code> prints a stack trace
+each time the \c SIGUSR1 signal is sent to the shell.