diff options
author | axel <axel@liljencrantz.se> | 2005-09-21 09:42:00 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2005-09-21 09:42:00 +1000 |
commit | e3ce01d6855c9330b1cd2dec19eff1139676c7db (patch) | |
tree | d982476194567eb2544a84fc12bfba1033995ccc /doc_src | |
parent | 3a60fc52061961ad98614c19e3e12a0e251e3777 (diff) |
Key binding functions
darcs-hash:20050920234200-ac50b-3895a97cb024368258cd1562bdcc9fda2c84f521.gz
Diffstat (limited to 'doc_src')
-rw-r--r-- | doc_src/function.txt | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/doc_src/function.txt b/doc_src/function.txt index aa818493..a8dba06f 100644 --- a/doc_src/function.txt +++ b/doc_src/function.txt @@ -1,10 +1,13 @@ \section function function - create a function \subsection function-synopsis Synopsis - <tt>function NAME; BODY; end </tt> + <tt>function [OPTIONS] NAME; BODY; end </tt> \subsection function-description Description +- <tt>-d DESCRIPTION</tt> or \c --description=DESCRIPTION is a description of what the function does, suitable as a completion 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. + 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 is entered. The function @@ -13,7 +16,7 @@ is entered. The function function hi echo hello end -</pre> +BB</pre> will write <tt>hello</tt> whenever the user enters \c hi. @@ -27,7 +30,7 @@ are inserted into the environment variable <a href="index.html#variables-arrays" </pre> will run the \c ls command, using the \c -l option, while passing on any additional files and switches to \c ls. - +A <pre> function mkdir -d "Create a directory and set CWD" mkdir $argv @@ -45,4 +48,4 @@ end will run the mkdir command, and if it is succesfull, change the current working directory to the one just created. - + |