summaryrefslogtreecommitdiffstats
path: root/doc/ParseArgs.3
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ParseArgs.3')
-rw-r--r--doc/ParseArgs.348
1 files changed, 12 insertions, 36 deletions
diff --git a/doc/ParseArgs.3 b/doc/ParseArgs.3
index ecff658..72cd75c 100644
--- a/doc/ParseArgs.3
+++ b/doc/ParseArgs.3
@@ -57,20 +57,14 @@ The collection of arguments to be parsed is described by the \fIargTable\fR
parameter. This points to a table of descriptor structures that is terminated
by an entry with the \fItype\fR field set to TCL_ARGV_END. As convenience, the
following prototypical entries are provided:
-.TP
-\fBTCL_ARGV_AUTO_HELP\fR
-.
+.IP \fBTCL_ARGV_AUTO_HELP\fR
Enables the argument processor to provide help when passed the argument
.QW \fB\-help\fR .
-.TP
-\fBTCL_ARGV_AUTO_REST\fR
-.
+.IP \fBTCL_ARGV_AUTO_REST\fR
Instructs the argument processor that arguments after
.QW \fB\-\-\fR
are to be unprocessed.
-.TP
-\fBTCL_ARGV_TABLE_END\fR
-.
+.IP \fBTCL_ARGV_TABLE_END\fR
Marks the end of the table of argument descriptors.
.SS "ARGUMENT DESCRIPTOR ENTRIES"
.PP
@@ -99,27 +93,19 @@ users when they request it.
As noted above, the \fItype\fR field is used to describe the interpretation of
the argument's value. The following values are acceptable values for
\fItype\fR:
-.TP
-\fBTCL_ARGV_CONSTANT\fR
-.
+.IP \fBTCL_ARGV_CONSTANT\fR
The argument does not take any following value argument. If this argument is
present, the (integer) value of the \fIsrcPtr\fR field is copied to the variable
pointed to by the \fIdstPtr\fR field. The \fIclientData\fR field is ignored.
-.TP
-\fBTCL_ARGV_END\fR
-.
+.IP \fBTCL_ARGV_END\fR
This value marks the end of all option descriptors in the table. All other
fields are ignored.
-.TP
-\fBTCL_ARGV_FLOAT\fR
-.
+.IP \fBTCL_ARGV_FLOAT\fR
This argument takes a following floating point value argument. The value (once
parsed by \fBTcl_GetDoubleFromObj\fR) will be stored as a double-precision
value in the variable pointed to by the \fIdstPtr\fR field. The \fIsrcPtr\fR
and \fIclientData\fR fields are ignored.
-.TP
-\fBTCL_ARGV_FUNC\fR
-.
+.IP \fBTCL_ARGV_FUNC\fR
This argument optionally takes a following value argument; it is up to the
handler callback function passed in \fIsrcPtr\fR to decide. That function will
have the following signature:
@@ -138,9 +124,7 @@ argument. The \fIclientData\fR is the value from the table entry, the
there are no following arguments at all, and the \fIdstPtr\fR argument to the
\fBTcl_ArgvFuncProc\fR is the location to write the parsed value to.
.RE
-.TP
-\fBTCL_ARGV_GENFUNC\fR
-.
+.IP \fBTCL_ARGV_GENFUNC\fR
This argument takes zero or more following arguments; the handler callback
function passed in \fIsrcPtr\fR returns how many (or a negative number to
signal an error, in which case it should also set the interpreter result). The
@@ -162,28 +146,20 @@ an array of all the remaining arguments, and \fIdstPtr\fR argument to the
\fBTcl_ArgvGenFuncProc\fR is the location to write the parsed value
(or values) to.
.RE
-.TP
-\fBTCL_ARGV_HELP\fR
-.
+.IP \fBTCL_ARGV_HELP\fR
This special argument does not take any following value argument, but instead
causes \fBTcl_ParseArgsObjv\fR to generate an error message describing the
arguments supported. All other fields except the \fIhelpStr\fR field are
ignored.
-.TP
-\fBTCL_ARGV_INT\fR
-.
+.IP \fBTCL_ARGV_INT\fR
This argument takes a following integer value argument. The value (once parsed
by \fBTcl_GetIntFromObj\fR) will be stored as an int in the variable pointed
to by the \fIdstPtr\fR field. The \fIsrcPtr\fR field is ignored.
-.TP
-\fBTCL_ARGV_REST\fR
-.
+.IP \fBTCL_ARGV_REST\fR
This special argument does not take any following value argument, but instead
marks all following arguments to be left unprocessed. The \fIsrcPtr\fR,
\fIdstPtr\fR and \fIclientData\fR fields are ignored.
-.TP
-\fBTCL_ARGV_STRING\fR
-.
+.IP \fBTCL_ARGV_STRING\fR
This argument takes a following string value argument. A pointer to the string
will be stored at \fIdstPtr\fR; the string inside will have a lifetime linked
to the lifetime of the string representation of the argument value that it