#include <cl.h> cl = cl_parse(argc, argv, optab);
The "cl_parse" function parses a command line, based on information given in an Options Table. For more information about constructing an Options Table, see "expl c internal parser" and "expl c internal parser macros".
The "argc" and "argv" arguments are usually the "argc" and "argv" values obtained as arguments to your program's "main" function. These give the arguments specified on the command line that invoked this program. The output of "cl_parse" is a data structure summarizing all the information obtained by parsing the command line.
If "cl_parse" cannot parse the command line at all, it returns a NULL pointer. In this case, the global variable
char *cl_fatal;
contains a message string explaining the cause of the failure.
It may also happen that "cl_parse" can parse the command line, but finds that the command line contains invalid input. For example, the command line may contain arguments which have the form of an option (like "-string") but which do not match any of the valid options in the Options Table. In this case, "cl_parse" returns a normal pointer to a parsed command line data structure. If you want to determine whether there were errors on the command line, you must call the "cl_errors" routine.
Copyright © 1996, Thinkage Ltd.