aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/function.txt
diff options
context:
space:
mode:
authorGravatar Mark Griffiths <mark@thebespokepixel.com>2014-09-03 15:10:53 +0100
committerGravatar Mark Griffiths <mark@thebespokepixel.com>2014-09-03 15:10:53 +0100
commitadbcecb456bc74f7a58dfae3daef0c7a45cd8d32 (patch)
tree8c5b677207e29246fe03b169bed45f6f4b795c3e /doc_src/function.txt
parent3df9e20ca762584d68df1f7c507592264acf83aa (diff)
Rebase documentation changes
Diffstat (limited to 'doc_src/function.txt')
-rw-r--r--doc_src/function.txt29
1 files changed, 18 insertions, 11 deletions
diff --git a/doc_src/function.txt b/doc_src/function.txt
index 096be806..8c4ba89b 100644
--- a/doc_src/function.txt
+++ b/doc_src/function.txt
@@ -13,15 +13,23 @@ A function is a list of commands that will be executed when the name of the func
The following options are available:
-- <code>-a NAMES</code> or <code>--argument-names NAMES</code> assigns the value of successive command-line arguments to the names given in NAMES.
-- <code>-d DESCRIPTION</code> or \c --description=DESCRIPTION is a description of what the function does, suitable as a completion description.
-- <code>-w WRAPPED_COMMAND</code> or \c --wraps=WRAPPED_COMMAND causes the function to inherit completions from the given wrapped command. See the documentation for \c complete for more information.
-- <code>-e</code> or <code>--on-event EVENT_NAME</code> tells fish to run this function when the specified named event is emitted. Fish internally generates named events e.g. when showing the prompt.
-- <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. Instead of PID, the string 'caller' can be specified. This is only legal when in a command substitution, and will result in the handler being triggered by the exit of the job which created this command substitution.
-- <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).
-- \c -S or \c --no-scope-shadowing allows the function to access the variables of calling functions. Normally, any variables inside the function that have the same name as variables from the calling function are "shadowed", and their contents is independent of the calling function.
-- <code>-v</code> or <code>--on-variable VARIABLE_NAME</code> tells fish to run this function when the variable VARIABLE_NAME changes value.
+- `-a NAMES` or `--argument-names NAMES` assigns the value of successive command-line arguments to the names given in NAMES.
+
+- `-d DESCRIPTION` or `--description=DESCRIPTION` is a description of what the function does, suitable as a completion description.
+
+- `-w WRAPPED_COMMAND` or `--wraps=WRAPPED_COMMAND` causes the function to inherit completions from the given wrapped command. See the documentation for <a href="#complete">`complete`</a> for more information.
+
+- `-e` or `--on-event EVENT_NAME` tells fish to run this function when the specified named event is emitted. Fish internally generates named events e.g. when showing the prompt.
+
+- `-j PID` or `--on-job-exit PID` tells fish to run this function when the job with group ID PID exits. Instead of PID, the string 'caller' can be specified. This is only legal when in a command substitution, and will result in the handler being triggered by the exit of the job which created this command substitution.
+
+- `-p PID` or `--on-process-exit PID` tells fish to run this function when the fish child process with process ID PID exits.
+
+- `-s` or `--on-signal SIGSPEC` 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).
+
+- `-S` or `--no-scope-shadowing` allows the function to access the variables of calling functions. Normally, any variables inside the function that have the same name as variables from the calling function are "shadowed", and their contents is independent of the calling function.
+
+- `-v` or `--on-variable VARIABLE_NAME` tells fish to run this function when the variable VARIABLE_NAME changes value.
If the user enters any additional arguments after the function, they are inserted into the environment <a href="index.html#variables-arrays">variable array</a> `$argv`. If the `--argument-names` option is provided, the arguments are also assigned to names specified in that option.
@@ -57,6 +65,5 @@ function mkdir -d "Create a directory and set CWD"
end
\endfish
-will run the mkdir command, and if it is successful, change the
-current working directory to the one just created.
+This will run the `mkdir` command, and if it is successful, change the current working directory to the one just created.