2005-09-20 13:31:55 +00:00
|
|
|
\section functions functions - print or erase functions
|
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
\subsection functions-synopsis Synopsis
|
2014-08-01 12:25:41 +00:00
|
|
|
\fish{synopsis}
|
2014-08-01 02:37:32 +00:00
|
|
|
functions [-a|--all] [-n|--names]
|
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.
2013-05-12 07:56:01 +00:00
|
|
|
functions -c OLDNAME NEWNAME
|
|
|
|
functions -d DESCRIPTION FUNCTION
|
2014-08-01 02:37:32 +00:00
|
|
|
functions [-eq] FUNCTIONS...
|
|
|
|
\endfish
|
2005-09-20 13:31:55 +00:00
|
|
|
|
|
|
|
\subsection functions-description Description
|
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
`functions` prints or erases functions.
|
2005-09-20 13:31:55 +00:00
|
|
|
|
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.
2013-05-12 07:56:01 +00:00
|
|
|
The following options are available:
|
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
- `-a` or `--all` lists all functions, even those whose name start with an underscore.
|
|
|
|
- `-c OLDNAME NEWNAME` or `--copy OLDNAME NEWNAME` creates a new function named NEWNAME, using the definition of the OLDNAME function.
|
|
|
|
- `-d DESCRIPTION` or `--description=DESCRIPTION` changes the description of this function.
|
|
|
|
- `-e` or `--erase` causes the specified functions to be erased.
|
|
|
|
- `-h` or `--help` displays a help message and exits.
|
|
|
|
- `-n` or `--names` lists the names of all defined functions.
|
|
|
|
- `-q` or `--query` tests if the specified functions exist.
|
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.
2013-05-12 07:56:01 +00:00
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
The default behavior of `functions`, when called with no arguments,
|
|
|
|
is to print the names of all defined functions. Unless the `-a` option is
|
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.
2013-05-12 07:56:01 +00:00
|
|
|
given, no functions starting with underscores are not included in the output.
|
2005-09-20 13:31:55 +00:00
|
|
|
|
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.
2013-05-12 07:56:01 +00:00
|
|
|
If any non-option parameters are given, the definition of the specified
|
2010-09-18 02:18:26 +00:00
|
|
|
functions are printed.
|
2005-09-20 13:31:55 +00:00
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
Automatically loaded functions cannot be removed using `functions
|
|
|
|
-e`. Either remove the definition file or change the
|
2006-07-12 17:46:55 +00:00
|
|
|
$fish_function_path variable to remove autoloaded functions.
|
2005-09-20 13:31:55 +00:00
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
Copying a function using `-c` copies only the body of the function, and
|
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.
2013-05-12 07:56:01 +00:00
|
|
|
does not attach any event notifications from the original function.
|
|
|
|
|
|
|
|
Only one function's description can be changed in a single invocation
|
2014-08-01 02:37:32 +00:00
|
|
|
of `functions -d`.
|
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.
2013-05-12 07:56:01 +00:00
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
The exit status of `functions` is the number of functions
|
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.
2013-05-12 07:56:01 +00:00
|
|
|
specified in the argument list that do not exist, which can be used in
|
2014-08-01 02:37:32 +00:00
|
|
|
concert with the `-q` option.
|
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.
2013-05-12 07:56:01 +00:00
|
|
|
|
|
|
|
\subsection functions-example Examples
|
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
`functions -n` displays a list of currently-defined functions.
|
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.
2013-05-12 07:56:01 +00:00
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
`functions -c foo bar` copies the `foo` function to a new function called
|
|
|
|
`bar`.
|
2010-09-12 10:29:34 +00:00
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
`functions -e bar` erases the function `bar`.
|