mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-25 20:41:15 -03:00
Documentation updates, mostly corrections and cla<rifications to the docs for a few builtins
darcs-hash:20060608235811-ac50b-76b4fd54cb0911dd00f19f4a7c761f188d6ca068.gz
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
\section function function - create a function
|
||||
|
||||
\subsection function-synopsis Synopsis
|
||||
<tt>function [OPTIONS] NAME; BODY; end </tt>
|
||||
<code>function [OPTIONS] NAME; BODY; end </code>
|
||||
|
||||
\subsection function-description Description
|
||||
|
||||
- \c -b or \c --key-binding specifies that the function is a key biding. Key binding functions work exactly like regular functions except that they can not be tab-completed, and may contain the '-' character.
|
||||
- <tt>-d DESCRIPTION</tt> or \c --description=DESCRIPTION is a description of what the function does, suitable as a completion description
|
||||
- <tt>-j PID</tt> or <tt> --on-job-exit PID</tt> tells fish to run this function when the job with group id PID exits
|
||||
- <tt>-p PID</tt> or <tt> --on-process-exit PID</tt> tells fish to run this function when the fish child process with process id PID exits
|
||||
- <tt>-s</tt> or <tt>--on-signal SIGSPEC</tt> tells fish to run this function when the signal SIGSPEC is delivered. SIGSPEC can be a signal number, or the signal name, such as SIGHUP (or just HUP)
|
||||
- <tt>-v</tt> or <tt>--on-variable VARIABLE_NAME</tt> tells fish to run this function when the variable VARIABLE_NAME changes value
|
||||
- <code>-d DESCRIPTION</code> or \c --description=DESCRIPTION is a description of what the function does, suitable as a completion description
|
||||
- <code>-j PID</code> or <code> --on-job-exit PID</code> tells fish to run this function when the job with group id PID exits
|
||||
- <code>-p PID</code> or <code> --on-process-exit PID</code> tells fish to run this function when the fish child process with process id PID exits
|
||||
- <code>-s</code> or <code>--on-signal SIGSPEC</code> tells fish to run this function when the signal SIGSPEC is delivered. SIGSPEC can be a signal number, or the signal name, such as SIGHUP (or just HUP)
|
||||
- <code>-v</code> or <code>--on-variable VARIABLE_NAME</code> tells fish to run this function when the variable VARIABLE_NAME changes value
|
||||
|
||||
This builtin command is used to create a new function. A Function is a
|
||||
list of commands that will be executed when the name of the function
|
||||
@@ -22,7 +22,7 @@ function hi
|
||||
end
|
||||
</pre>
|
||||
|
||||
will write <tt>hello</tt> whenever the user enters \c hi.
|
||||
will write <code>hello</code> whenever the user enters \c hi.
|
||||
|
||||
If the user enters any additional arguments after the function, they
|
||||
are inserted into the environment variable <a href="index.html#variables-arrays">array</a> argv.
|
||||
|
||||
Reference in New Issue
Block a user