From aca0511762f3f233e971983ee3d60615f0da6824 Mon Sep 17 00:00:00 2001 From: axel Date: Wed, 11 Jan 2006 23:29:44 +1000 Subject: [PATCH] Documentation corrections darcs-hash:20060111132944-ac50b-43146f4df54b8a533fb92693f1292d6cb74cdef8.gz --- doc_src/doc.hdr | 71 ++++++++++++++++++++++++++++--------------------- doc_src/set.txt | 36 ++++++++++++++----------- 2 files changed, 60 insertions(+), 47 deletions(-) diff --git a/doc_src/doc.hdr b/doc_src/doc.hdr index 4b2deefa4..5299b850d 100644 --- a/doc_src/doc.hdr +++ b/doc_src/doc.hdr @@ -23,7 +23,7 @@ Example: calls the \c echo command. \c echo is a command which will write its arguments to the screen. In the example above, the output will be 'hello world'. Everything in fish is done with commands. There are -commands for performing a set of command multiple times, commands for +commands for performing a set of commands multiple times, commands for assigning variables, commands for treating a group of commands as a single command, etc.. And every single command follows the same simple syntax. @@ -38,7 +38,7 @@ topic. There are manual pages for almost every command on most computers. There are also manual pages for many other things, such as system libraries and important files. -Every program on a computer can be used as a command in \c fish. If +Every program on your computer can be used as a command in \c fish. If the program file is located in one of the directories in the PATH, it is sufficient to type the name of the program to use it. Otherwise the whole filename, including the @@ -78,7 +78,11 @@ Example: rm "cumbersome filename.txt" -Will remove the file 'cumbersome filename.txt'. +Will remove the file 'cumbersome filename.txt', while + +rm cumbersome filename.txt + +would remove the two files 'cumbersome' and 'filenmae.txt'. \subsection escapes Escaping characters @@ -138,8 +142,8 @@ which directs the output of the echo command to the file error.txt. DESTINATION can be one of the following: - A filename. The output will be written to the specified file. -- An ampersand (\&) followed by the number of a file descriptor. The file descriptor will be a duplicate of the specified file descriptor. -- A minus sign (-). The FD will be closed. +- An ampersand (\&) followed by the number of another file descriptor. The file descriptor will be a duplicate of the specified file descriptor. +- A minus sign (-). The file descriptor will be closed. Example: @@ -239,15 +243,16 @@ type fg -h or help fg. Tab completion is one of the most time saving features of any modern shell. By tapping the tab key, the user asks \c fish to guess the rest -of the command or parameter that the user is currently typing. If -there is only one possible completion, \c fish will write it out. If -there is more than one completion, \c fish will write out the longest -common prefix that all completions have in common. If all completions -differ on the first character, a list of all possible completions is -printed. The list features descriptions of the completions and if the -list doesn't fit the screen, it is scrollable by using the arrow keys, -the page up/page down keys or the space bar. Press any other key will -exit the list and insert the pressed key into the command line. +of the command or parameter that the user is currently typing. If \c +fish can only find one possible completion, \c fish will write it +out. If there is more than one completion, \c fish will write out the +longest common prefix that all completions have in common. If all +completions differ on the first character, a list of all possible +completions is printed. The list features descriptions of the +completions and if the list doesn't fit the screen, it is scrollable +by using the arrow keys, the page up/page down keys or the space +bar. Press any other key will exit the list and insert the pressed key +into the command line. These are the general purpose tab completions that \c fish provides: @@ -261,20 +266,20 @@ These are the general purpose tab completions that \c fish provides: of these completions are simple options like the \c -l option for \c ls, but some are more advanced. The latter include: -- The programs 'man' and 'whatis' complete using all installed -manual pages. -- The 'make' program complete using all targets in the Makefile in -the current directory. -- The 'mount' command complete using all mount points specified in fstab. -- The 'ssh' command complete using all hosts in that are stored -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. +- The programs 'man' and 'whatis' show all installed +manual pages as completions. +- The 'make' program uses all targets in the Makefile in +the current directory as completions. +- The 'mount' command uses all mount points specified in fstab as completions. +- The 'ssh' command uses all hosts in that are stored +in the known_hosts file as completions. (see the ssh documentation for more information) +- The 'su' command uses all users on the system as completions. +- The \c apt-get, \c rpm and \c yum commands use all installed packages as completions. \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 +completion, use the \c complete command. \c complete takes as a parameter the name of the command to specify a completion for. For example, to add a completion for the program \c myprog, one would start the completion command with complete -c myprog @@ -361,7 +366,7 @@ PNG format. \subsection expand-brace Brace expansion -A comma separated list of characters enclosed en curly braces will be +A comma separated list of characters enclosed in curly braces will be expanded so each element of the list becomes a new parameter. Example: @@ -403,8 +408,9 @@ there once along the way was a '}' in there somewhere, and } is not a valid character in a variable name. So anything after the otherwise pointless bracket expansion becomes NOT a part of the variable name, even if it happens to be a legal variable name character. That's why -'{$USER}san' works. A case of one syntax just lending itself so nicely -to solving an unrelated problem in it's spare time. +'{$USER}san' looks for the variable '$USER' and not for the variable +'$USERsan'. It's a case of one syntax lending itself nicely to +solving an unrelated problem in it's spare time. Variable expansion is the only type of expansion performed on double quoted strings. There is, however, an important difference in how @@ -695,7 +701,7 @@ The following commands are distributed with fish. Many of them are builtins or shellscript functions, and can only be used inside fish. - ., read and execute the commands in a file -- and, execute second command if first suceeds +- and, execute command if previous command suceeded - bg, set a command to the background - begin, execute a block of commands - bind, change keyboard bindings @@ -727,7 +733,7 @@ builtins or shellscript functions, and can only be used inside fish. - mimedb, view mimedata about a file - nextd, move forward in the directory history - not, negates the exit status of any command -- or, execute second command if first fails +- or, execute a command if previous command failed - popd, move to the topmost directory on the directory stack - prevd, move backwards in the direcotry stack - pushd, push the surrent directory onto the directory stack @@ -739,7 +745,7 @@ builtins or shellscript functions, and can only be used inside fish. - switch, conditionally execute a block of commands - tokenize, split a string up into multiple tokens - ulimit, set or get the shells resurce usage limits -- umask, set or get the file creation mask +- umask, set or get the file creation mask - while, perform a block of commands while a condition is met For more information about these commands, use the --help @@ -769,7 +775,7 @@ Here are some of the commands available in the editor: - Alt-d move next word to the killring - Alt-w prints a short description of the command under the cursor - Alt-l lists the contents of the current directory, unless the cursor is over a directory argument, in which case the contents of that directory will be listed -- Alt-p adds the string '| less;' to the end of the job under the cursor. The result is that the output of the command will be paged.aadddddssss +- Alt-p adds the string '| less;' to the end of the job under the cursor. The result is that the output of the command will be paged. You can change these key bindings by making an inputrc file. To do this, copy the file /etc/fish_inputrc to your home directory and @@ -941,6 +947,9 @@ function fish_prompt -d "Write out the prompt" printf '\%s\@\%s\%s\%s\%s> ' (whoami) (hostname|cut -d . -f 1) (set_color \$fish_color_cwd) (prompt_pwd) (set_color normal) end + +where \c prompt_pwd is a shellscript function that displays a condensed version of the current working direcotry. +

diff --git a/doc_src/set.txt b/doc_src/set.txt index c185c441f..fb9bfbdfc 100644 --- a/doc_src/set.txt +++ b/doc_src/set.txt @@ -1,22 +1,24 @@ \section set set - Handle environment variables. \subsection set-synopsis Synopsis -set [OPTIONS] VARIABLE_NAME [VALUES...] +set [OPTIONS] [VARIABLE_NAME [VALUES...]] -The set builtin causes fish to assign the variable VARIABLE_NAME the values VALUES.... +The set builtin causes fish to assign the variable VARIABLE_NAME the values VALUES.... \subsection set-description Description -- -e or --erase causes the specified environment variable to be erased -- -g or --global causes the specified environment variable to be made global. If this option is not supplied, the specified variable will dissapear when the current block ends -- -l or --local forces the specified environment variable to be made local to the current block, even if the variable already exists and is non-local -- -n or --names List only the names of all defined variables -- -q or --query test if the specified variable names are defined. Does not output anything, but the builtins exit status is the number of variables specified that were not defined. -- -u or --unexport causes the specified environment not to be exported to child processes -- -U or --universal causes the specified environment variable to be made universal. If this option is supplied, the variable will be shared between all the current users fish instances on the current computer, and will be preserved across restarts of the shell. -- -x or --export causes the specified environment variable to be exported to child processes +- -e or --erase causes the specified environment variable to be erased +- -g or --global causes the specified environment variable to be made global. If this option is not supplied, the specified variable will dissapear when the current block ends +- -l or --local forces the specified environment variable to be made local to the current block, even if the variable already exists and is non-local +- -n or --names List only the names of all defined variables +- -q or --query test if the specified variable names are defined. Does not output anything, but the builtins exit status is the number of variables specified that were not defined. +- -u or --unexport causes the specified environment not to be exported to child processes +- -U or --universal causes the specified environment variable to be made universal. If this option is supplied, the variable will be shared between all the current users fish instances on the current computer, and will be preserved across restarts of the shell. +- -x or --export causes the specified environment variable to be exported to child processes If set is called with no arguments, the names and values of all -environment variables are printed. +environment variables are printed. If some of the scope or export +flags have been given, only the variables matching the specified scope +are printed. If the \c -e or \c --erase option is specified, the variable specified by the following arguments will be erased @@ -25,13 +27,15 @@ If a variable is set to more than one value, the variable will be an array with the specified elements. If a variable is set to zero elements, it will become an array with zero elements. -If the variable name is one or more array elements, such as PATH[1 -3 7], only those array elements specified will be changed. +If the variable name is one or more array elements, such as PATH[1 +3 7], only those array elements specified will be changed. \subsection set-example Example -set foo hi sets the value of the variable foo to be hi. +set -xg will print all global, exported variables. -set -e smurf removes the variable \c smurf. +set foo hi sets the value of the variable foo to be hi. -set PATH[4] ~/bin changes the fourth element of the \c PATH array to \c ~/bin +set -e smurf removes the variable \c smurf. + +set PATH[4] ~/bin changes the fourth element of the \c PATH array to \c ~/bin