diff options
Diffstat (limited to 'doc/switch.n')
-rw-r--r-- | doc/switch.n | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/doc/switch.n b/doc/switch.n index 13edde8..21ecfc2 100644 --- a/doc/switch.n +++ b/doc/switch.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: switch.n,v 1.18 2008/03/21 19:22:31 dkf Exp $ +'\" RCS: @(#) $Id: switch.n,v 1.19 2008/06/29 22:28:24 dkf Exp $ '\" .so man.macros .TH switch n 8.5 Tcl "Tcl Built-In Commands" @@ -33,32 +33,33 @@ command returns an empty string. .PP If the initial arguments to \fBswitch\fR start with \fB\-\fR then they are treated as options -.VS 8.5 unless there are exactly two arguments to \fBswitch\fR (in which case the first must the \fIstring\fR and the second must be the \fIpattern\fR/\fIbody\fR list). -.VE 8.5 The following options are currently supported: .TP 10 \fB\-exact\fR +. Use exact matching when comparing \fIstring\fR to a pattern. This is the default. .TP 10 \fB\-glob\fR +. When matching \fIstring\fR to the patterns, use glob-style matching (i.e. the same as implemented by the \fBstring match\fR command). .TP 10 \fB\-regexp\fR +. When matching \fIstring\fR to the patterns, use regular expression matching (as described in the \fBre_syntax\fR reference page). -'\" Options defined by TIP#75 -.VS 8.5 .TP 10 \fB\-nocase\fR +. Causes comparisons to be handled in a case-insensitive manner. .TP 10 \fB\-matchvar\fR \fIvarName\fR +. This option (only legal when \fB\-regexp\fR is also specified) specifies the name of a variable into which the list of matches found by the regular expression engine will be written. The first @@ -71,6 +72,7 @@ empty list written to it. This option may be specified at the same time as the \fB\-indexvar\fR option. .TP 10 \fB\-indexvar\fR \fIvarName\fR +. This option (only legal when \fB\-regexp\fR is also specified) specifies the name of a variable into which the list of indices referring to matching substrings @@ -85,15 +87,13 @@ capturing parenthesis in the regular expression that matched, and so on. When a \fBdefault\fR branch is taken, the variable will have the empty list written to it. This option may be specified at the same time as the \fB\-matchvar\fR option. -.VE 8.5 .TP 10 \fB\-\|\-\fR +. Marks the end of options. The argument following this one will be treated as \fIstring\fR even if it starts with a \fB\-\fR. -.VS 8.5 This is not required when the matching patterns and bodies are grouped together in a single argument. -.VE 8.5 .PP Two syntaxes are provided for the \fIpattern\fR and \fIbody\fR arguments. The first uses a separate argument for each of the patterns and commands; @@ -161,7 +161,6 @@ last) is taken. This example has a result of \fI3\fR: } .CE .PP -.VS 8.5 When matching against regular expressions, information about what exactly matched is easily obtained using the \fB\-matchvar\fR option: .CS @@ -175,7 +174,6 @@ exactly matched is easily obtained using the \fB\-matchvar\fR option: } } .CE -.VE 8.5 .SH "SEE ALSO" for(n), if(n), regexp(n) .SH KEYWORDS |