diff --git a/doc_src/complete.txt b/doc_src/complete.txt index 30d643eb3..0f703f937 100644 --- a/doc_src/complete.txt +++ b/doc_src/complete.txt @@ -4,6 +4,11 @@ complete (-c|--command|-p|--path) COMMAND [(-s|--short-option) SHORT_OPTION] [(-l|--long-option|-o|--old-option) LONG_OPTION [(-a||--arguments) OPTION_ARGUMENTS] [(-d|--description) DESCRIPTION] \subsection complete-description Description + +For an introduction to how to specify completions, see the section Writing your own completions of +the fish manual. + - COMMAND is the name of the command for which to add a completion - SHORT_OPTION is a one character option for the command - LONG_OPTION is a multi character option for the command @@ -61,7 +66,9 @@ are valid, like the \c nodeps switch. This can be written as: -complete -c rpm -n "__fish_contains_opt -s e erase" -l nodeps -d 'Dont check dependencies' +complete -c rpm -n "__fish_contains_opt -s e erase" -l nodeps -d +"Don't check dependencies" -where \c __fish_contains_opt is a function that checks the commandline buffer for the presense of a specified set of options. +where \c __fish_contains_opt is a function that checks the commandline +buffer for the presense of a specified set of options. diff --git a/doc_src/doc.hdr b/doc_src/doc.hdr index 14eab4151..88dbd2591 100644 --- a/doc_src/doc.hdr +++ b/doc_src/doc.hdr @@ -7,9 +7,11 @@ href="http://roo.no-ip.org/fish/">fish homepage. \section syntax Syntax overview -Shells like \c fish are used by giving them commands. Every \c fish command follows the same simple syntax. +Shells like \c fish are used by giving them commands. Every \c fish +command follows the same simple syntax. -A command is executed by writing the name of the command followed by any arguments. +A command is executed by writing the name of the command followed by +any arguments. Example: @@ -264,6 +266,8 @@ in the known_hosts file. (see the ssh documentation for more information) - The 'su' command complete using all users on the system - The \c apt-get, \c rpm and \c tym commands complete using all installed packages. +\subsection completion-own Writing your own completions + Specifying your own completions is not complicated. To specify a completion, one simply uses the \c complete command. \c complete takes as a parameter the name of the command to specify a completion @@ -342,7 +346,8 @@ parameter. Example: -The command echo (basename image.jpg .jpg).png will output 'image.png'. +The command echo (basename image.jpg .jpg).png will +output 'image.png'. The command for i in *.jpg; convert $i (basename $i .jpg).png; end will convert all Jpeg files in the current directory to the