From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6881 invoked by alias); 10 May 2015 18:39:52 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35077 Received: (qmail 5524 invoked from network); 10 May 2015 18:39:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Biglobe-Sender: From: Jun T To: zsh-workers@zsh.org Cc: Jun-ichi Takimoto Subject: [PATCH 4/4] improve manual format (ch.23-26) Date: Mon, 11 May 2015 02:48:50 +0900 Message-Id: <1431280130-26058-5-git-send-email-takimoto-j@kba.biglobe.ne.jp> X-Mailer: git-send-email 1.9.5 (Apple Git-50.3) In-Reply-To: <1431280130-26058-1-git-send-email-takimoto-j@kba.biglobe.ne.jp> References: <1431280130-26058-1-git-send-email-takimoto-j@kba.biglobe.ne.jp> X-Biglobe-Spnum: 58822 From: Jun-ichi Takimoto --- Doc/Zsh/calsys.yo | 19 ++++++++------ Doc/Zsh/contrib.yo | 77 +++++++++++++++++++++++++++++------------------------- Doc/Zsh/tcpsys.yo | 70 +++++++++++++++++++++++++------------------------ Doc/Zsh/zftpsys.yo | 52 ++++++++++++++++++------------------ 4 files changed, 114 insertions(+), 104 deletions(-) diff --git a/Doc/Zsh/calsys.yo b/Doc/Zsh/calsys.yo index 6b5fe27..c20c87e 100644 --- a/Doc/Zsh/calsys.yo +++ b/Doc/Zsh/calsys.yo @@ -272,7 +272,7 @@ When an anchor time is present, there is an extension to handle regular events in the form of the var(n)th var(some)day of the month. Such a specification must occur immediately after any year and month specification, but before any time of day, and must be in the form -var(n)tt(LPAR()th|st|rd+RPAR()) var(day), for example tt(1st Tuesday) or +var(n)(tt(th)|tt(st)|tt(rd)) var(day), for example tt(1st Tuesday) or tt(3rd Monday). As in other places, days are matched case insensitively, must be in English, and only the first three letters are significant except that a form beginning `month' does not match `Monday'. No attempt is made @@ -320,8 +320,11 @@ subsect(Calendar system functions) startitem() findex(calendar) -xitem(tt(calendar) [ tt(-abdDsv) ] [ tt(-C) var(calfile) ] [ -n var(num) ] [ tt(-S) var(showprog) ] [ [ var(start) ] var(end) ])( -item(tt(calendar -r) [ tt(-abdDrsv) ] [ tt(-C) var(calfile) ] [ -n var(num) ] [ tt(-S) var(showprog) ] [ var(start) ])( +redef(SPACES)(0)(tt(ifztexi(NOTRANS(@ @ @ @ @ @ @ @ @ ))ifnztexi( ))) +xitem(tt(calendar )[ tt(-abdDsv) ] [ tt(-C) var(calfile) ] [ tt(-n) var(num) ] [ tt(-S) var(showprog) ]) +xitem(SPACES()[ [ var(start) ] var(end) ]) +xitem(tt(calendar -r) [ tt(-abdDrsv) ] [ tt(-C) var(calfile) ] [ tt(-n) var(num) ] [ tt(-S) var(showprog) ]) +item(SPACES()[ var(start) ])( Show events in the calendar. With no arguments, show events from the start of today until the end of @@ -379,9 +382,9 @@ Show at least var(num) events, if present in the calendar file, regardless of the tt(start) and tt(end). ) item(tt(-r))( -Show all the remaining options in the calendar, ignoring the given tt(end) -time. The tt(start) time is respected; any argument given is treated -as a tt(start) time. +Show all the remaining options in the calendar, ignoring the given var(end) +time. The var(start) time is respected; any argument given is treated +as a var(start) time. ) item(tt(-s))( Use the shell's tt(sched) command to schedule a timed event that @@ -471,7 +474,7 @@ the dates in the calendar file. enditem() ) findex(calendar_add) -item(tt(calendar_add) [ tt(-BL) ] var(event ...))( +item(tt(calendar_add) [ tt(-BL) ] var(event) ...)( Adds a single event to the calendar in the appropriate location. The event can contain multiple lines, as described in ifnzman(noderef(Calendar File and Date Formats))\ @@ -578,7 +581,7 @@ keywords and values.) endsitem() findex(calendar_showdate) -item(tt(calendar_showdate) [ tt(-r) ] [ tt(-f) var(fmt) ] var(date-spec ...))( +item(tt(calendar_showdate) [ tt(-r) ] [ tt(-f) var(fmt) ] var(date-spec) ...)( The given var(date-spec) is interpreted and the corresponding date and time printed. If the initial var(date-spec) begins with a tt(PLUS()) or tt(-) it is treated as relative to the current time; var(date-spec)s after diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 24be63e..8b6b7d3 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -98,7 +98,7 @@ be used to keep function digests up to date. startitem() findex(zrecompile) xitem(tt(zrecompile) [ tt(-qt) ] [ var(name) ... ]) -item(tt(zrecompile) [ tt(-qt) ] tt(-p) var(args) [ tt(-)tt(-) var(args) ... ])( +item(tt(zrecompile) [ tt(-qt) ] tt(-p) var(arg) ... [ tt(-)tt(-) var(arg) ... ])( This tries to find tt(*.zwc) files and automatically re-compile them if at least one of the original files is newer than the compiled file. This works only if the names stored in the compiled files are full paths or are @@ -118,7 +118,7 @@ Without the tt(-t) option, the return status is zero if all files that needed re-compilation could be compiled and non-zero if compilation for at least one of the files failed. -If the tt(-p) option is given, the var(args) are interpreted as one +If the tt(-p) option is given, the var(arg)s are interpreted as one or more sets of arguments for tt(zcompile), separated by `tt(-)tt(-)'. For example: @@ -174,7 +174,7 @@ findex(zkbd) The large number of possible combinations of keyboards, workstations, terminals, emulators, and window systems makes it impossible for zsh to have built-in key bindings for every situation. The tt(zkbd) utility, -found in Functions/Misc, can help you quickly create key bindings for your +found in tt(Functions/Misc), can help you quickly create key bindings for your configuration. Run tt(zkbd) either as an autoloaded function, or as a shell script: @@ -291,7 +291,7 @@ cindex(hook function utility) startitem() findex(add-zsh-hook) -item(tt(add-zsh-hook) [-dD] var(hook) var(function))( +item(tt(add-zsh-hook) [ tt(-dD) ] [ tt(-Uzk) ] var(hook) var(function))( Several functions are special to the shell, as described in the section ifnzman(Special Functions, noderef(Functions))\ ifzman(SPECIAL FUNCTIONS, see zmanref(zshmisc)), @@ -635,7 +635,7 @@ PS1='%F{5}[%F{2}%n%F{5}] %F{3}%3~ ${vcs_info_msg_0_}%f%# ') Obviously, the last two lines are there for demonstration. You need to call tt(vcs_info) from your tt(precmd) function. Once that is done you need -a tt(single quoted) tt('${vcs_info_msg_0_}') in your prompt. +a em(single quoted) tt('${vcs_info_msg_0_}') in your prompt. To be able to use tt('${vcs_info_msg_0_}') directly in your prompt like this, you will need to have the tt(PROMPT_SUBST) option enabled. @@ -865,7 +865,7 @@ in the repository. kindex(command) item(tt(command))( This style causes tt(vcs_info) to use the supplied string as the command -to use as the VCS's binary. Note, that setting this in ':vcs_info:*' is +to use as the VCS's binary. Note, that setting this in 'tt(:vcs_info:*)' is not a good idea. If the value of this style is empty (which is the default), the used binary @@ -1219,12 +1219,12 @@ without restarting the shell. ) enditem() -All functions named VCS_INFO_* are for internal use only. +All functions named tt(VCS_INFO_*) are for internal use only. subsect(Variable Description) startitem() -item(tt(${vcs_info_msg_)var(N)tt(_}) (Note the trailing underscore)) +item(tt(${vcs_info_msg_)var(N)tt(_)}) (Note the trailing underscore)) ( Where var(N) is an integer, e.g., tt(vcs_info_msg_0_). These variables are the storage for the informational message the last tt(vcs_info) call @@ -1237,7 +1237,7 @@ exported into the environment. (See the tt(max-exports) style above.) ) enditem() -All variables named VCS_INFO_* are for internal use only. +All variables named tt(VCS_INFO_*) are for internal use only. subsect(Hooks in vcs_info) @@ -1256,7 +1256,7 @@ example(zstyle ':vcs_info:*+foo:*' hooks bar baz) This registers functions to the hook `foo' for all backends. In order to avoid namespace problems, all registered function names are prepended by -a `+vi-', so the actual functions called for the `foo' hook are +a `tt(+vi-)', so the actual functions called for the `foo' hook are `tt(+vi-bar)' and `tt(+vi-baz)'. If you would like to register a function to a hook regardless of the @@ -1377,7 +1377,7 @@ tt(patch-format) and tt(nopatch-format) styles. item(tt(no-vcs))( This hooks is called when no version control system was detected. -The `hook_com' parameter is not used. +The `tt(hook_com)' parameter is not used. ) item(tt(post-backend))( Called as soon as the backend has finished collecting information. @@ -1442,8 +1442,8 @@ will be used unchanged instead of an expanded format from tt(patch-format) or tt(nopatch-format). ) item(tt(set-message))( -Called each time before a `tt(vcs_info_msg_N_)' message is set. -It takes two arguments; the first being the `N' in the message +Called each time before a `tt(vcs_info_msg_)var(N)tt(_)' message is set. +It takes two arguments; the first being the `var(N)' in the message variable name, the second is the currently configured tt(formats) or tt(actionformats). @@ -1468,8 +1468,8 @@ tt(vcs_info). ) enditem() -If all of this sounds rather confusing, take a look at the tt(Examples) -section below and also in the Misc/vcs_info-examples file in the Zsh source. +If all of this sounds rather confusing, take a look at the bf(Examples) +section below and also in the tt(Misc/vcs_info-examples) file in the Zsh source. They contain some explanatory code. subsect(Examples) @@ -1487,8 +1487,8 @@ Provide a special formats for tt(git): example(zstyle ':vcs_info:git:*' formats ' GIT, BABY! [%b]' zstyle ':vcs_info:git:*' actionformats ' GIT ACTION! [%b|%a]') -All tt(%x) expansion in all sorts of formats ("formats", "actionformats", -branchformat, you name it) are done using the `tt(zformat)' builtin from +All tt(%x) expansion in all sorts of formats (tt(formats), tt(actionformats), +tt(branchformat), you name it) are done using the `tt(zformat)' builtin from the `tt(zsh/zutil)' module. That means you can do everything with these tt(%x) items what zformat supports. In particular, if you want something that is really long to have a fixed width, like a hash in a mercurial @@ -1504,16 +1504,17 @@ example(zstyle ':vcs_info:bzr:*' use-simple true) If you do use tt(use-simple), please report if it does `the-right-thing[tm]'. Display the revision number in yellow for tt(bzr) and tt(svn): -example(zstyle ':vcs_info:(svn|bzr):*' branchformat '%b%{'${fg[yellow]}'%}:%r') +example(zstyle ':vcs_info:(svn|bzr):*' \ + branchformat '%b%{'${fg[yellow]}'%}:%r') -If you want colors, make sure you enclose the color codes in tt(%{...%}) +If you want colors, make sure you enclose the color codes in tt(%{)var(...)tt(%}) if you want to use the string provided by tt(vcs_info) in prompts. Here is how to print the VCS information as a command (not in a prompt): example(alias vcsi='vcs_info command; vcs_info_lastmsg') This way, you can even define different formats for output via -tt(vcs_info_lastmsg) in the ':vcs_info:*:command:*' namespace. +tt(vcs_info_lastmsg) in the 'tt(:vcs_info:*:command:*)' namespace. Now as promised, some code that uses hooks: say, you'd like to replace the string `svn' by `subversion' in @@ -1846,7 +1847,8 @@ Neither of the styles tt(word-chars) nor tt(word-class) is used in this case. Here are some examples of use of the tt(word-context) style to extend the context. -example(zstyle ':zle:*' word-context "*/*" file "[[:space:]]" whitespace +example(zstyle ':zle:*' word-context \ + "*/*" file "[[:space:]]" whitespace zstyle ':zle:transpose-words:whitespace' word-style shell zstyle ':zle:transpose-words:filename' word-style normal zstyle ':zle:transpose-words:filename' word-chars '') @@ -2268,8 +2270,9 @@ using a two-character mnemonic. ) tindex(narrow-to-region) tindex(narrow-to-region-invisible) -xitem(tt(narrow-to-region [ -p) var(pre) tt(] [ -P) var(post) tt(])) -xitem( tt([ -S) var(statepm) tt(| -R) var(statepm) tt(] [ -n ] [) var(start) var(end) tt(]))) +redef(SPACES)(0)(tt(ifztexi(NOTRANS(@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ ))ifnztexi( ))) +xitem(tt(narrow-to-region )[ tt(-p) var(pre) ] [ tt(-P) var(post) ]) +xitem(SPACES()[ tt(-S) var(statepm) | tt(-R) var(statepm) ] [ tt(-n) ] [ var(start) var(end) ]) item(tt(narrow-to-region-invisible))( Narrow the editable portion of the buffer to the region between the cursor and the mark, which may be in either order. The region may not be empty. @@ -2920,8 +2923,8 @@ command to an appropriate viewer. startitem() findex(zsh-mime-setup) findex(zsh-mime-handler) -xitem(tt(zsh-mime-setup) [ tt(-fv) ] [ tt(-l) [ var(suffix ...) ] ]) -item(tt(zsh-mime-handler [-l] var(command arguments ...)))( +xitem(tt(zsh-mime-setup) [ tt(-fv) ] [ tt(-l) [ var(suffix) ... ] ]) +item(tt(zsh-mime-handler) [ tt(-l) ] var(command argument) ...)( These two functions use the files tt(~/.mime.types) and tt(/etc/mime.types), which associate types and extensions, as well as tt(~/.mailcap) and tt(/etc/mailcap) files, which associate types and the programs that @@ -3805,11 +3808,13 @@ ifzman(above)\ ifnzman((noderef(Utilities))). ) findex(zmv) -item(tt(zmv) [ tt(-finqQsvwW) ] [ -C | -L | -M | -[pP] var(program) ] [ -o var(optstring) ] var(srcpat) var(dest) )( +redef(SPACES)(0)(tt(ifztexi(NOTRANS(@ @ @ @ ))ifnztexi( ))) +xitem(tt(zmv) [ tt(-finqQsvwW) ] [ tt(-C) | tt(-L) | tt(-M) | -{tt(p)|tt(P)} var(program) ] [ tt(-o) var(optstring) ]) +item(SPACES()var(srcpat) var(dest) )( Move (usually, rename) files matching the pattern var(srcpat) to corresponding files having names of the form given by var(dest), where var(srcpat) contains parentheses surrounding patterns which will be -replaced in turn by $1, $2, ... in var(dest). For example, +replaced in turn by tt($1), tt($2), ... in var(dest). For example, example(zmv '(*).lis' '$1.txt') @@ -3829,7 +3834,7 @@ sitem(tt(-f))(Force overwriting of destination files. Not currently passed down to the tt(mv)/tt(cp)/tt(ln) command due to vagaries of implementations (but you can use tt(-o-f) to do that).) sitem(tt(-i))(Interactive: show each line to be executed and ask the user -whether to execute it. `Y' or `y' will execute it, anything else will +whether to execute it. `tt(Y)' or `tt(y)' will execute it, anything else will skip it. Note that you just need to type one character.) sitem(tt(-n))(No execution: print what would happen, but don't do it.) sitem(tt(-q))(Turn bare glob qualifiers off: now assumed by default, so @@ -3841,7 +3846,7 @@ sitem(tt(-v))(Verbose: print each command as it's being executed.) sitem(tt(-w))(Pick out wildcard parts of the pattern, as described above, and implicitly add parentheses for referring to them.) sitem(tt(-W))(Just like tt(-w), with the addition of turning wildcards in -the replacement pattern into sequential ${1} .. ${N} references.) +the replacement pattern into sequential tt(${1}) .. tt(${N}) references.) sxitem(tt(-C)) sxitem(tt(-L)) sitem(tt(-M))(Force tt(cp), tt(ln) or tt(mv), respectively, regardless of @@ -3879,18 +3884,18 @@ ifzman(above)\ ifnzman((noderef(Utilities))). ) findex(zstyle+) -item(tt(zstyle+) var(context) var(style) var(value) [ + var(subcontext) var(style) var(value) ... ])( +item(tt(zstyle+) var(context) var(style) var(value) [ tt(+) var(subcontext) var(style) var(value) ... ])( This makes defining styles a bit simpler by using a single `tt(+)' as a special token that allows you to append a context name to the previously used context name. Like this: -example(zstyle+ ':foo:bar' style1 value1 \ - + ':baz' style2 value2 \ - + ':frob' style3 value3) +example(zstyle+ ':foo:bar' var(style1) var(value1) \ + + ':baz' var(style2) var(value2) \ + + ':frob' var(style3) var(value3)) -This defines `style1' with `value1' for the context tt(:foo:bar) as usual, -but it also defines `style2' with `value2' for the context -tt(:foo:bar:baz) and `style3' with `value3' for tt(:foo:bar:frob). Any +This defines var(style1) with var(value1) for the context tt(:foo:bar) as usual, +but it also defines var(style2) with var(value2) for the context +tt(:foo:bar:baz) and var(style3) with var(value3) for tt(:foo:bar:frob). Any var(subcontext) may be the empty string to re-use the first context unchanged. ) diff --git a/Doc/Zsh/tcpsys.yo b/Doc/Zsh/tcpsys.yo index 4067859..f9b403c 100644 --- a/Doc/Zsh/tcpsys.yo +++ b/Doc/Zsh/tcpsys.yo @@ -7,10 +7,10 @@ sect(Description) A module tt(zsh/net/tcp) is provided to provide network I/O over TCP/IP from within the shell; see its description in ifzman(\ -zmanref(zshmodules) +zmanref(zshmodules)\ )\ ifnzman(\ -noderef(Zsh Modules) +noderef(Zsh Modules)\ ). This manual page describes a function suite based on the module. If the module is installed, the functions are usually installed at the same time, in which case they will be available for @@ -19,10 +19,10 @@ tt(zsh/net/tcp) module, the tt(zsh/zselect) module is used to implement timeouts on read operations. For troubleshooting tips, consult the corresponding advice for the tt(zftp) functions described in ifzman(\ -zmanref(zshzftpsys) +zmanref(zshzftpsys)\ )\ ifnzman(\ -noderef(Zftp Function System) +noderef(Zftp Function System)\ ). There are functions corresponding to the basic I/O operations open, close, @@ -53,9 +53,9 @@ subsect(Basic I/O) startitem() findex(tcp_open) -xitem(tt(tcp_open [-qz]) var(host port) tt([) var(sess) tt(])) -xitem(tt(tcp_open [-qz] [ -s) var(sess) tt(| -l) var(sess)tt(,... ] ... )) -item(tt(tcp_open [-qz] [-a) var(fd) tt(| -f) var(fd) tt(] [) var(sess) tt(]))( +xitem(tt(tcp_open) [ tt(-qz) ] var(host port) [ var(sess) ]) +xitem(tt(tcp_open) [ tt(-qz) ] [ tt(-s) var(sess) | tt(-l) var(sess)[tt(,)...] ] ... ) +item(tt(tcp_open) [ tt(-qz) ] [ tt(-a) var(fd) | tt(-f) var(fd) ] [ var(sess) ])( Open a new session. In the first and simplest form, open a TCP connection to host var(host) at port var(port); numeric and symbolic forms are understood for both. @@ -102,7 +102,7 @@ will not print informational messages, although it will in any case exit with an appropriate status. If the line editor (zle) is in use, which is typically the case if the -shell is interactive, tt(tcp_open) installs a handler inside tt(zle) which +shell is interactive, tt(tcp_open) installs a handler inside zle which will check for new data at the same time as it checks for keyboard input. This is convenient as the shell consumes no CPU time while waiting; the test is performed by the operating system. Giving the option tt(-z) to @@ -123,7 +123,7 @@ The function tt(tcp_on_open), if defined, is called when a session is opened. See the description below. ) findex(tcp_close) -item(tt(tcp_close [-qn] [ -a | -l) var(sess)tt(,... |) var(sess) tt(... ]))( +item(tt(tcp_close) [ tt(-qn) ] [ tt(-a) | tt(-l) var(sess)[tt(,)...] | var(sess) ... ])( Close the named sessions, or the current session if none is given, or all open sessions if tt(-a) is given. The options tt(-l) and tt(-s) are both handled for consistency with tt(tcp_open), although the latter is @@ -142,8 +142,9 @@ session. If the option tt(-q) is given, no informational messages will be printed. ) findex(tcp_read) -xitem(tt(tcp_read [-bdq] [ -t) var(TO) tt(] [ -T) var(TO) tt(])) -item( tt([ -a | -u) var(fd) tt(... | -l) var(sess)tt(,... | -s) var(sess) tt(...]))( +redef(SPACES)(0)(tt(ifztexi(NOTRANS(@ @ @ @ @ @ @ @ @ ))ifnztexi( ))) +xitem(tt(tcp_read )[ tt(-bdq) ] [ tt(-t) var(TO) ] [ tt(-T) var(TO) ]) +item(SPACES()[ tt(-a) | tt(-u) var(fd)[tt(,)...] | tt(-l) var(sess)[tt(,)...] | tt(-s) var(sess) ... ])( Perform a read operation on the current session, or on a list of sessions if any are given with tt(-u), tt(-l) or tt(-s), or all open sessions if the option tt(-a) is given. Any of the tt(-u), tt(-l) or @@ -189,8 +190,8 @@ non-zero return status indicates some error condition. See tt(tcp_log) for how to control where data is sent by tt(tcp_read). ) findex(tcp_send) -xitem(tt(tcp_send [-cnq] [ -s) var(sess) tt(| -l) var(sess)tt(,... ]) var(data) tt(...)) -item(tt(tcp_send [-cnq] -a) var(data) tt(...))( +xitem(tt(tcp_send) [ tt(-cnq) ] [ tt(-s) var(sess) | tt(-l) var(sess)[tt(,)...] ] var(data) ...) +item(tt(tcp_send) [ tt(-cnq) ] tt(-a) var(data) ...)( Send the supplied data strings to all the specified sessions in turn. The underlying operation differs little from a `tt(print -r)' to the session's file descriptor, although it attempts to prevent the shell from dying owing @@ -220,9 +221,9 @@ subsect(Session Management) startitem() findex(tcp_alias) -xitem(tt(tcp_alias [-q]) var(alias)tt(=)var(sess) tt(...)) -xitem(tt(tcp_alias [-q] [) var(alias) tt(] ...)) -item(tt(tcp_alias -d [-q]) var(alias) tt(...))( +xitem(tt(tcp_alias) [ tt(-q) ] var(alias)tt(=)var(sess) ...) +xitem(tt(tcp_alias) [ tt(-q) ] [ var(alias) ... ]) +item(tt(tcp_alias) tt(-d) [ tt(-q) ] var(alias) ...)( This function is not particularly well tested. The first form creates an alias for a session name; var(alias) can then be @@ -238,14 +239,14 @@ The option tt(-q) suppresses an inconsistently chosen subset of error messages. ) findex(tcp_log) -item(tt(tcp_log [-asc] [ -n | -N ] [) var(logfile) tt(]))( +item(tt(tcp_log) [ tt(-asc) ] [ tt(-n) | tt(-N) ] [ var(logfile) ])( With an argument var(logfile), all future input from tt(tcp_read) will be logged to the named file. Unless tt(-a) (append) is given, this file will first be truncated or created empty. With no arguments, show the current status of logging. With the option tt(-s), per-session logging is enabled. Input from -tt(tcp_read) is output to the file var(logfile).var(sess). As the +tt(tcp_read) is output to the file var(logfile)tt(.)var(sess). As the session is automatically discriminated by the filename, the contents are raw (no tt($TCP_PROMPT)). The option tt(-a) applies as above. Per-session logging and logging of all data in one file are not mutually @@ -265,7 +266,7 @@ item(tt(tcp_rename) var(old) var(new))( Rename session var(old) to session var(new). The old name becomes invalid. ) findex(tcp_sess) -item(tt(tcp_sess [) var(sess) tt([) var(command) tt(... ] ]))( +item(tt(tcp_sess) [ var(sess) [ var(command) [ var(arg) ... ] ] ])( With no arguments, list all the open sessions and associated file descriptors. The current session is marked with a star. For use in functions, direct access to the parameters tt($tcp_by_name), tt($tcp_by_fd) @@ -275,9 +276,9 @@ With a var(sess) argument, set the current session to var(sess). This is equivalent to changing tt($TCP_SESS) directly. With additional arguments, temporarily set the current session while -executing the string tt(command ...). The first argument is re-evaluated -so as to expand aliases etc., but the remaining arguments are passed -through as the appear to tt(tcp_sess). The original session is restored +executing `var(command) var(arg) ...'. var(command) is re-evaluated +so as to expand aliases etc., but the remaining var(arg)s are passed +through as that appear to tt(tcp_sess). The original session is restored when tt(tcp_sess) exits. ) enditem() @@ -286,7 +287,7 @@ subsect(Advanced I/O) startitem() findex(tcp_command) -item(tt(tcp_command) var(send-options) tt(...) var(send-arguments) tt(...))( +item(tt(tcp_command) var(send-option) ... var(send-argument) ...)( This is a convenient front-end to tt(tcp_send). All arguments are passed to tt(tcp_send), then the function pauses waiting for data. While data is arriving at least every tt($TCP_TIMEOUT) (default 0.3) seconds, data is @@ -299,8 +300,9 @@ programme or function it is generally better to handle reading data by a more explicit method. ) findex(tcp_expect) -xitem(tt(tcp_expect [ -q ] [ -p ) var(var) tt( | -P ) var(var) tt(] [ -t ) var(to) tt(| -T) var(TO)tt(])) -item(tt( [ -a | -s) var(sess) tt(... | -l) var(sess)tt(,... ]) var(pattern) ...)( +redef(SPACES)(0)(tt(ifztexi(NOTRANS(@ @ @ @ @ @ @ @ @ @ @ ))ifnztexi( ))) +xitem(tt(tcp_expect )[ tt(-q) ] [ tt(-p) var(var) | tt(-P) var(var) ] [ tt(-t) var(TO) | tt(-T) var(TO) ]) +item(SPACES()[ tt(-a) | tt(-s) var(sess) | tt(-l) var(sess)[tt(,)...] ] var(pattern) ...)( Wait for input matching any of the given var(pattern)s from any of the specified sessions. Input is ignored until an input line matches one of the given patterns; at this point status zero is returned, the matching @@ -371,8 +373,8 @@ The command is run in the background, so tt(tcp_proxy) can then accept new connections. It continues to accept new connections until interrupted. ) findex(tcp_spam) -item(tt(tcp_spam [-ertv] [ -a | -s ) var(sess) tt(| -l) var(sess)tt(,... ]) var(cmd) tt(...))( -Execute `var(cmd) tt(...)' for each session in turn. Note this executes +item(tt(tcp_spam) [ tt(-ertv) ] [ tt(-a) | tt(-s) var(sess) | tt(-l) var(sess)[tt(,)...] ] var(cmd) [ var(arg) ... ])( +Execute `var(cmd) [ var(arg) ... ]' for each session in turn. Note this executes the command and arguments; it does not send the command line as data unless the tt(-t) (transmit) option is given. @@ -389,19 +391,19 @@ tt($tcp_spam_list) array or on the command line are spammed in the order given. The tt(-r) flag reverses the order however it was arrived it. The tt(-v) flag specifies that a tt($TCP_PROMPT) will be output before each -session. This is output after any modification to TCP_SESS by the +session. This is output after any modification to tt(TCP_SESS) by the user-defined tt(tcp_on_spam) function described below. (Obviously that function is able to generate its own output.) -If the option tt(-e) is present, the line given as var(cmd ...) is executed +If the option tt(-e) is present, the line given as `var(cmd) [ var(arg) ... ]' is executed using tt(eval), otherwise it is executed without any further processing. ) findex(tcp_talk) item(tt(tcp_talk))( This is a fairly simple-minded attempt to force input to the line editor to -go straight to the default TCP_SESSION. +go straight to the default tt(TCP_SESS). -An escape string, tt($TCP_TALK_ESCAPE), default `:', is used to allow +An escape string, tt($TCP_TALK_ESCAPE), default `tt(:)', is used to allow access to normal shell operation. If it is on its own at the start of the line, or followed only by whitespace, the line editor returns to normal operation. Otherwise, the string and any following whitespace are skipped @@ -507,7 +509,7 @@ This is called after a session has been renamed with the three arguments old session name, file descriptor, new session name. ) findex(tcp_on_spam) -item(tt(tcp_on_spam) var(sess) var(command) tt(...))( +item(tt(tcp_on_spam) var(sess) var(command ...))( This is called once for each session spammed, just em(before) a command is executed for a session by tt(tcp_spam). The arguments are the session name followed by the command list to be executed. If tt(tcp_spam) was called @@ -554,7 +556,7 @@ tt(tcp_on_read)) to tell if is being called when the shell is otherwise idle at the editor prompt. ) findex(tcp_output) -item(tt(tcp_output [ -q ] -P) var(prompt) tt(-F) var(fd) tt(-S) var(sess))( +item(tt(tcp_output) [ tt(-q) ] tt(-P) var(prompt) tt(-F) var(fd) tt(-S) var(sess))( This function is used for both logging and handling output to standard output, from within tt(tcp_read) and (if tt($TCP_OUTPUT) is set) tt(tcp_send). @@ -786,7 +788,7 @@ sect(TCP Examples) Here is a trivial example using a remote calculator. -TO create a calculator server on port 7337 (see the tt(dc) manual page for +To create a calculator server on port 7337 (see the tt(dc) manual page for quite how infuriating the underlying command is): example(tcp_proxy 7337 dc) diff --git a/Doc/Zsh/zftpsys.yo b/Doc/Zsh/zftpsys.yo index 5630830..00062e4 100644 --- a/Doc/Zsh/zftpsys.yo +++ b/Doc/Zsh/zftpsys.yo @@ -75,10 +75,10 @@ are treated literally (a single `tt(-)' is treated as an argument). subsect(Opening a connection) startitem() findex(zfparams) -item(tt(zfparams [ var(host) [ var(user) [ var(password) ... ] ] ]))( +item(tt(zfparams) [ var(host) [ var(user) [ var(password) ... ] ] ])( Set or show the parameters for a future tt(zfopen) with no arguments. If no arguments are given, the current parameters are displayed (the password -will be shown as a line of asterisks). If a host is given, and either the +will be shown as a line of asterisks). If a var(host) is given, and either the var(user) or var(password) is not, they will be prompted for; also, any parameter given as `tt(?)' will be prompted for, and if the `tt(?)' is followed by a string, that will be used as the prompt. As tt(zfopen) calls @@ -90,7 +90,7 @@ also cause the memory of the last directory (and so on) on the other host to be deleted. ) findex(zfopen) -item(tt(zfopen [ -1 ] [ var(host) [ var(user) [ var(password) [ var(account) ] ] ] ]))( +item(tt(zfopen) [ tt(-1) ] [ var(host) [ var(user) [ var(password) [ var(account) ] ] ] ])( If var(host) is present, open a connection to that host under username var(user) with password var(password) (and, on the rare occasions when it is necessary, account var(account)). If a necessary parameter is missing or @@ -119,7 +119,7 @@ to trigger recognition of the var(path). Note prefixes other than slash beyond var(host) are significant in var(path). ) findex(zfanon) -item(tt(zfanon [ -1 ] var(host)))( +item(tt(zfanon) [ tt(-1) ] var(host))( Open a connection var(host) for anonymous FTP. The username used is `tt(anonymous)'. The password (which will be reported the first time) is generated as var(user)tt(@)var(host); this is then stored in the shell @@ -131,9 +131,9 @@ enditem() subsect(Directory management) startitem() findex(zfcd) -xitem(tt(zfcd [ var(dir) ])) +xitem(tt(zfcd) [ var(dir) ]) xitem(tt(zfcd -)) -item(tt(zfcd var(old) var(new)))( +item(tt(zfcd) var(old) var(new))( Change the current directory on the remote server: this is implemented to have many of the features of the shell builtin tt(cd). @@ -168,7 +168,7 @@ For example, if the current local directory is tt(~/foo/bar), then tt(zfhere) performs the effect of `tt(zfcd ~/foo/bar)'. ) findex(zfdir) -item(tt(zfdir [ -rfd ] [ - ] [ var(dir-options) ] [ var(dir) ]))( +item(tt(zfdir) [ tt(-rfd) ] [ tt(-) ] [ var(dir-options) ] [ var(dir) ])( Produce a long directory listing. The arguments var(dir-options) and var(dir) are passed directly to the server and their effect is implementation dependent, but specifying a particular remote directory @@ -207,7 +207,7 @@ or binary. With an argument, change the type: the types `tt(A)' or `tt(IMAGE)' for binary data are understood case-insensitively. ) findex(zfstat) -item(tt(zfstat) [ -v ])( +item(tt(zfstat) [ tt(-v) ])( Show the status of the current or last connection, as well as the status of some of tt(zftp)'s status variables. With the tt(-v) option, a more verbose listing is produced by querying the server for its version of @@ -224,7 +224,7 @@ see the description of the function tt(zfrtime) below for more information. startitem() findex(zfget) -item(tt(zfget [ -Gtc ] var(file1) ...))( +item(tt(zfget) [ tt(-Gtc) ] var(file1) ...)( Retrieve all the listed files var(file1) ... one at a time from the remote server. If a file contains a `tt(/)', the full name is passed to the remote server, but the file is stored locally under the name given by the @@ -233,7 +233,7 @@ be sent as a single stream to standard output; in this case the tt(-t) option has no effect. ) findex(zfuget) -item(tt(zfuget [ -Gvst ] var(file1) ...))( +item(tt(zfuget) [ tt(-Gvst) ] var(file1) ...)( As tt(zfget), but only retrieve files where the version on the remote server is newer (has a later modification time), or where the local file does not exist. If the remote file is older but the files have different @@ -244,7 +244,7 @@ option tt(-v), the command prints more information about the files while it is working out whether or not to transfer them. ) findex(zfcget) -item(tt(zfcget [ -Gt ] var(file1) ...))( +item(tt(zfcget) [ tt(-Gt) ] var(file1) ...)( As tt(zfget), but if any of the local files exists, and is shorter than the corresponding remote file, the command assumes that it is the result of a partially completed transfer and attempts to transfer the rest of the @@ -254,8 +254,8 @@ Note that this requires a commonly implemented, but non-standard, version of the FTP protocol, so is not guaranteed to work on all servers. ) findex(zfgcp) -xitem(tt(zfgcp [ -Gt ] var(remote-file) var(local-file))) -item(tt(zfgcp [ -Gt ] var(rfile1) ... var(ldir)))( +xitem(tt(zfgcp) [ tt(-Gt) ] var(remote-file) var(local-file)) +item(tt(zfgcp) [ tt(-Gt) ] var(rfile1) ... var(ldir))( This retrieves files from the remote server with arguments behaving similarly to the tt(cp) command. @@ -271,7 +271,7 @@ enditem() subsect(Sending files) startitem() findex(zfput) -item(tt(zfput [ -r ] var(file1) ...))( +item(tt(zfput) [ tt(-r) ] var(file1) ...)( Send all the var(file1) ... given separately to the remote server. If a filename contains a `tt(/)', the full filename is used locally to find the file, but only the basename is used for the remote file name. @@ -282,13 +282,13 @@ with `tt(.)'. This requires that the remote machine understand UNIX file semantics, since `tt(/)' is used as a directory separator. ) findex(zfuput) -item(tt(zfuput [ -vs ] var(file1) ...))( +item(tt(zfuput) [ tt(-vs) ] var(file1) ...)( As tt(zfput), but only send files which are newer than their local equivalents, or if the remote file does not exist. The logic is the same as for tt(zfuget), but reversed between local and remote files. ) findex(zfcput) -item(tt(zfcput var(file1) ...))( +item(tt(zfcput) var(file1) ...)( As tt(zfput), but if any remote file already exists and is shorter than the local equivalent, assume it is the result of an incomplete transfer and send the rest of the file to append to the existing part. As the FTP @@ -296,8 +296,8 @@ append command is part of the standard set, this is in principle more likely to work than tt(zfcget). ) findex(zfpcp) -xitem(tt(zfpcp var(local-file) var(remote-file))) -item(tt(zfpcp var(lfile1) ... var(rdir)))( +xitem(tt(zfpcp) var(local-file) var(remote-file)) +item(tt(zfpcp) var(lfile1) ... var(rdir))( This sends files to the remote server with arguments behaving similarly to the tt(cp) command. @@ -381,7 +381,7 @@ directory where your zsh startup files live (usually tt(~)). startitem() findex(zfmark) -item(tt(zfmark [ )var(bookmark)tt( ]))( +item(tt(zfmark) [ var(bookmark) ])( If given an argument, mark the current host, user and directory under the name var(bookmark) for later use by tt(zfgoto). If there is no connection open, use the values for the last connection immediately before it was @@ -394,7 +394,7 @@ this is the format in which they are stored, and the file may be edited directly. ) findex(zfgoto) -item(tt(zfgoto [ -n ] )var(bookmark))( +item(tt(zfgoto) [ tt(-n) ] var(bookmark))( Return to the location given by var(bookmark), as previously set by tt(zfmark). If the location has user `tt(ftp)' or `tt(anonymous)', open the connection with tt(zfanon), so that no password is required. If the @@ -417,13 +417,13 @@ alter tt(zftp_chpwd) and tt(zftp_progress), in particular. startitem() findex(zfinit) -item(tt(zfinit [ -n ]))( +item(tt(zfinit) [ tt(-n) ])( As described above, this is used to initialize the zftp function system. The tt(-n) option should be used if the zftp command is already built into the shell. ) findex(zfautocheck) -item(tt(zfautocheck [ -dn ]))( +item(tt(zfautocheck) [ tt(-dn) ])( This function is called to implement automatic reopening behaviour, as described in more detail below. The options must appear in the first argument; tt(-n) prevents the command from changing to the old directory, @@ -458,7 +458,7 @@ were any matches, the same variable will be set to the expanded set of filenames on return. ) findex(zfrtime) -item(tt(zfrtime var(lfile) var(rfile) [ var(time) ]))( +item(tt(zfrtime) var(lfile) var(rfile) [ var(time) ])( Set the local file var(lfile) to have the same modification time as the remote file var(rfile), or the explicit time var(time) in FTP format tt(CCYYMMDDhhmmSS) for the GMT timezone. This uses the shell's @@ -556,12 +556,12 @@ As described for tt(progress), tt(zfinit) will force this to default to 1. ) kindex(remote-glob, zftp style) item(tt(remote-glob))( -If set to `1', `yes' or `true', filename generation (globbing) is +If set to `tt(1)', `tt(yes)' or `tt(true)', filename generation (globbing) is performed on the remote machine instead of by zsh itself; see below. ) kindex(titlebar, zftp style) item(tt(titlebar))( -If set to `1', `yes' or `true', tt(zftp_chpwd) will put the remote host and +If set to `tt(1)', `tt(yes)' or `tt(true)', tt(zftp_chpwd) will put the remote host and remote directory into the titlebar of terminal emulators such as xterm or sun-cmd that allow this. @@ -569,7 +569,7 @@ As described for tt(progress), tt(zfinit) will force this to default to 1. ) kindex(chpwd, zftp style) item(tt(chpwd))( -If set to `1' `yes' or `true', tt(zftp_chpwd) will call the function +If set to `tt(1)' `tt(yes)' or `tt(true)', tt(zftp_chpwd) will call the function tt(chpwd) when a connection is closed. This is useful if the remote host details were put into the terminal title bar by tt(zftp_chpwd) and your usual tt(chpwd) also modifies the title bar. -- 1.9.5 (Apple Git-50.3)