2005-09-20 21:31:55 +08:00
\section functions functions - print or erase functions
\subsection function-synopsis Synopsis
2006-06-09 07:58:11 +08:00
<code>functions [-e] FUNCTIONS...</code>
2005-09-20 21:31:55 +08:00
\subsection functions-description Description
This builtin command is used to print or erase functions.
2006-06-09 07:58:11 +08:00
- <code>-a</code> or <code>--all</code> list all functions, even those whose name start with an underscore.
2010-09-12 18:29:34 +08:00
- <code>-c OLDNAME NEWNAME</code> or <code>--copy OLDNAME NEWNAME</code> creates a new function named NEWNAME, using the definition of the OLDNAME function.
2006-06-09 07:58:11 +08:00
- <code>-d DESCRIPTION</code> or <code>--description=DESCRIPTION</code> change the description of this function
- <code>-e</code> or <code>--erase</code> causes the specified functions to be erased.
- <code>-h</code> or <code>--help</code> display a help message and exit
2006-08-31 23:44:00 +08:00
- <code>-n</code> or <code>--names</code> list only the names of all defined functions, not their definition
2006-07-13 01:46:55 +08:00
- <code>-q</code> or <code>--query</code> test if the specified functions exist. Does not output anything, but the builtins exit status is the number of functions specified that were not defined.
2005-09-20 21:31:55 +08:00
2006-07-13 01:46:55 +08:00
The default behavior of \c functions when called with no arguments,
is to print the names and definitions of all defined functions. If any
non-switch parameters are given, only the definition of the specified
2010-09-18 10:18:26 +08:00
functions are printed.
2005-09-20 21:31:55 +08:00
2006-07-13 01:46:55 +08:00
Automatically loaded functions can not be removed using functions
-e. Either remove the definition file or change the
$fish_function_path variable to remove autoloaded functions.
2005-09-20 21:31:55 +08:00
2010-09-12 18:29:34 +08:00
Function copies, created with -c, will not have any event/signal/on-exit
notifications that the original may have had.
2006-07-13 01:46:55 +08:00
The exit status of the functions builtin is the number functions
specified in the argument list that do not exist.