aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/function.txt
Commit message (Collapse)AuthorAge
* add `function --shadow-builtin` flagGravatar Kurtis Rader2016-05-14
| | | | | | | | | | | | | | It's currently too easy for someone to bork their shell by doing something like `function test; return 0; end`. That's obviously a silly, contrived, example but the point is that novice users who learn about functions are prone to do something like that without realizing it will bork the shell. Even expert users who know about the `test` builtin might forget that, say, `pwd` is a builtin. This change adds a `--shadow-builtin` flag that must be specified to indicate you know what you're doing. Fixes #3000
* documents function options must follow nameGravatar Jeremy W. Sherman2015-05-17
| | | | | When declaring a function using the function "function", the options must follow, not precede, the function name. The examples demonstrate this syntax, but the synopsis previously showed the options preceding the name.
* Add new `functions` flag -V/--inherit-variableGravatar Kevin Ballard2014-10-02
| | | | | | | | | | --inherit-variable takes a variable name and snapshots its current value. When the function is executed, it will have a local variable with this value already defined. Printing the function source will include synthesized `set -l` lines for the values. This is primarily useful for functions that are created on the fly, such as in `psub`.
* Added fish_preexec and fish_postexec eventsGravatar Jan-Thorsten Peter2014-10-01
| | | | Fixes #1549.
* Rebase documentation changesGravatar Mark Griffiths2014-09-03
|
* Make line length, wrapping and spacing consistentGravatar Mark Griffiths2014-09-03
|
* Simplify stylingGravatar Mark Griffiths2014-09-03
|
* Documentation updateGravatar Mark Griffiths2014-09-03
| | | | | | Rework for Doxygen >1.8. Moved large parts of the documentation to a simplified format, making use of Markdown enhancements and fixing bad long options.
* Support for command wrapping ("aliases")Gravatar ridiculousfish2014-08-15
| | | | | | | | | | | | | | | | | | | | | | | Add the --wraps option to 'complete' and 'function'. This allows a command to (recursively) inherit the completions of a wrapped command. Fixes #393. When evaluating a completion, we inspect the entire "wrap chain" for a command, i.e. we follow the sequence of wrapping until we either hit a loop (which we silently ignore) or the end of the chain. We then evaluate completions as if the wrapping command were substituted with the wrapped command. Currently this only works for commands, i.e. 'complete --command gco --wraps git\ checkout' won't work (that would seem to encroaching on abbreviations anyways). It might be useful to show an error message for that case. The commandline builtin reflects the commandline with the wrapped command substituted in, so e.g. git completions (which inspect the command line) will just work. This sort of command line munging is also performed by 'complete -C' so it's not totally without precedent. 'alias will also now mark its generated function as wrapping the 'target.
* documentation for test and function (closes: #734)Gravatar David Adam (zanchey)2013-07-29
| | | | | | | plus speling in documentation for bind. Note that this commit does not re-enable the generation of the manpage for test, which will therefore still fall through to the system manual page with `man test`.
* Help cleanupGravatar David Adam (zanchey)2013-05-13
| | | | | | | | | | 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.
* make 'alias' check for recursive calls and insert 'command'; update docs, ↵Gravatar Jan Kanis2013-01-01
| | | | fix #486
* Removed some debugging code used in determining autosuggestion truncationGravatar ridiculousfish2012-12-11
| | | | Fixed a busted link in the function doc
* Add more documentation on eventsGravatar liljencrantz2008-01-17
| | | | darcs-hash:20080116222531-75c98-ef30dabc492d7883dbb620c40ef95152469057a3.gz
* Minor edits, remove unneeded code, add a few commants, correct spelling, ↵Gravatar axel2006-10-26
| | | | | | tweak the todo list, etc. darcs-hash:20061026102253-ac50b-eb42fdab9a9211d68386a563134856a96b870d90.gz
* Make any character except '/' legal in function namesGravatar axel2006-10-20
| | | | darcs-hash:20061019154747-ac50b-f3ab0df1085b91ec0eadcceddb23f03d5b0247aa.gz
* Documentation updates from Beni CherniavskyGravatar axel2006-09-20
| | | | darcs-hash:20060919145203-ac50b-bc87b8f5e6a18395e4bc3e364da4a40ad97850e7.gz
* Minor documentation tweaks and additionsGravatar axel2006-07-20
| | | | darcs-hash:20060720133319-ac50b-ea71dc172f0c60de0d6f1effa2092ebb8d8ca2d9.gz
* The syntax for 'function --on-job-exit caller' was flat out wrong in the ↵Gravatar axel2006-06-18
| | | | | | docs. Fixed. darcs-hash:20060617141426-ac50b-835a389b29243023739315f21135f19c5f010c5a.gz
* Documentation updates, mostly corrections and cla<rifications to the docs ↵Gravatar axel2006-06-09
| | | | | | for a few builtins darcs-hash:20060608235811-ac50b-76b4fd54cb0911dd00f19f4a7c761f188d6ca068.gz
* Fixed various spelling mistakes.Gravatar James Vega2006-01-24
| | | | darcs-hash:20060123231706-35ec8-2a30db603eee503d944b06d101cc88ce59340309.gz
* Documentation and completion updatesGravatar axel2005-10-21
| | | | darcs-hash:20051021123945-ac50b-3d3b5004fdf8424190cae84c7b27b2088c87c080.gz
* Event handling and job reaping updatesGravatar axel2005-10-12
| | | | darcs-hash:20051011192343-ac50b-aa3f5ae5e2b34d122f10e3b59ceb6fdd447f4ae3.gz
* Minor tweaksGravatar axel2005-09-21
| | | | darcs-hash:20050920235718-ac50b-a6e0fc1960a8172415fb8a5ebcce81f921d87b10.gz
* Key binding functionsGravatar axel2005-09-21
| | | | darcs-hash:20050920234200-ac50b-3895a97cb024368258cd1562bdcc9fda2c84f521.gz
* Add subdirectoriesGravatar axel2005-09-20
darcs-hash:20050920133155-ac50b-9a14c6c664dd03afbe8e15e7c7998fcfb5c3c750.gz