tclParseArgv.c
ABSTRACT:
This file contains software that parses Tcl verbs and formats error
or help statments in a standard way. It uses the ftcl package
ftcl_ParseArgv and associated routines.
DESCRIPTION:
Output help for a Tcl verb constructed from the arg table.
RETURN VALUES:
HELP STRING - success
NULL STRING - Failed miserably. Error stack is set.
SIGNATURE:
char *shTclGetArgInfo
(
Tcl_Interp *a_interp, /* IN: Tcl Interpreter */
ftclArgvInfo *a_argTable, /* IN: The arg table */
int a_flags, /* IN: Flags as for ftcl_ArgInfo */
char *a_cmdName /* IN: Name of command */
)
DESCRIPTION:
Output the usage string for a Tcl verb constructed from the arg
table.
RETURN VALUES:
USAGE STRING - Successful completion.
NULL STRING - Failed miserably. Error stack is set.
SIGNATURE:
char *shTclGetUsage
(
Tcl_Interp *a_interp, /* IN: Tcl Interpreter */
ftclArgvInfo *a_argTable, /* IN: The arg table */
int a_flags, /* IN: Flags as for ftcl_GetUsage */
char *a_cmdName /* IN: Name of command */
)
DESCRIPTION:
Ouput help and usage information for a Tcl verb that is constructed
from the arg table.
RETURN VALUES:
HELP/USAGE STRING - success
NULL STRING - Failed miserably. Error stack is set.
SIGNATURE:
char *shTclGetHelp
(
Tcl_Interp *a_interp, /* IN: Tcl Interpreter */
ftclArgvInfo *a_argTable, /* IN: The arg table */
int a_flags, /* IN: Flags to ftcl_GetHelp */
char *a_cmdName /* IN: Name of command */
)
DESCRIPTION:
Call the dervish parser to parse the command line and load the interp
result string on error or on a help request.
RETURN VALUES:
FTCL_ARGV_SUCCESS - Successful completion.
TCL_OK - Help requested and loaded into error stack
TCL_ERROR - Failed miserably. Interp->result contains the
error string and the usage string.
SIGNATURE:
int shTclParseArgv
(
Tcl_Interp *a_interp, /* IN: Tcl Interpreter */
int *a_argc, /* IN: Number of command line arguments */
char *a_argv[], /* IN: Command line argugment array */
ftclArgvInfo *a_argTable, /* IN: The arg table */
int a_flags, /* IN: Flags to ftcl_ParseArgv */
char *a_cmdName /* IN: Name of command */
)
Call the ftcl parser, ftclParseArg, to parse a TCL command line
and load the interp result string on error or on a help request.
TCL params are:
$args - The arguements to the TCL procedure
formal_args - The formal argument definitions
see man ftclParseArg
See also $DERVISH_DIR/etc/shplot.tcl for an example
command_name - The name of the command being parsed
RETURN VALUES:
TCL_OK - Parse completed normally
TCL_RETURN - Help requested and loaded into the result
TCL_ERROR - Failed miserably. Interp->result contains the
error string and the usage string.
SIGNATURE:
int shTclParseArg
(
ClientData clientData,
Tcl_Interp *a_interp, /* IN: Tcl Interpreter */
int a_argc, /* IN: Number of command line arguments */
char *a_argv[] /* IN: Command line argugment array */
)