diff options
author | Mark Griffiths <mark@thebespokepixel.com> | 2014-08-19 13:41:23 +0100 |
---|---|---|
committer | Mark Griffiths <mark@thebespokepixel.com> | 2014-09-03 14:43:26 +0100 |
commit | 137abd0cfaa8959224f88a4ebe9584a51468cc88 (patch) | |
tree | c396f760a1e309b5a837359e65c57c4555534d49 /doc_src/function.txt | |
parent | d7308fecbe573aad91fc6f1377c1ed2df735f6fd (diff) |
Make line length, wrapping and spacing consistent
Diffstat (limited to 'doc_src/function.txt')
-rw-r--r-- | doc_src/function.txt | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/doc_src/function.txt b/doc_src/function.txt index 74dc9de5..096be806 100644 --- a/doc_src/function.txt +++ b/doc_src/function.txt @@ -9,8 +9,7 @@ function [OPTIONS] NAME; BODY; end `function` creates a new function `NAME` with the body `BODY`. -A function is a list of commands that will be executed when the name of the -function is given as a command. +A function is a list of commands that will be executed when the name of the function is given as a command. The following options are available: @@ -24,16 +23,15 @@ The following options are available: - \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. -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. +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. By using one of the event handler switches, a function can be made to run automatically at specific events. The user may generate new events using the <a href="#emit">emit</a> builtin. Fish generates the following named events: - `fish_prompt`, which is emitted whenever a new fish prompt is about to be displayed. + - `fish_command_not_found`, which is emitted whenever a command lookup failed. + \subsection function-example Example \fish |