#include <cl.h> cl = cl_cparse(argc, argv, optab, header);
The "cl_cparse" function parses a command line, in the same way as "cl_parse". For more information, see "expl c internal parser cl_parse".
"cl_cparse" automatically checks the command line to see if it contains the option +HELP or -HELP. If so, "cl_cparse" calls "cl_usage" to print out usage information on "stdout", then calls "exit" to terminate the program with an EXIT_SUCCESS status.
If there is no +HELP or -HELP, "cl_cparse" calls the "cl_errors" function to determine if any errors were encountered during the parsing process. If there were errors, "cl_errors" automatically outputs appropriate error diagnostics to "stderr". It uses the specified header string as a heading line for the diagnostic messages. Once "cl_errors" has output its diagnostics, "cl_cparse" calls "exit" to terminate the program with an EXIT_FAILURE status.
Copyright © 1996, Thinkage Ltd.