#include <cl.h> cl = cl_ceparse(argc, argv, optab, env_name, header);
The "cl_ceparse" function parses a command line, in a similar way to "cl_cparse". For more information, see "expl c internal parser cl_cparse".
The one significant difference between "cl_ceparse" and "cl_cparse" is that "cl_ceparse" uses an environment variable value as well as the other arguments. The function uses "getenv" to determine the value of the specified variable, then begins parsing this value in the same way that it would parse a command line. After this, "cl_ceparse" parses the true command line. If an argument on the command line matches an argument from the environment variable, the command line argument overwrites the setting inside the "cl" structure. Therefore, settings from the environment variable override any defaults set in the original Options Table, but settings on the command line override any corresponding settings in the environment variable.
Like "cl_cparse", "cl_ceparse" outputs usage information if it finds +HELP or -HELP, and terminates the program. If "cl_ceparse" encounters any parsing errors, it calls "cl_errors" to output appropriate diagnostics, then terminates the program.
Copyright © 1996, Thinkage Ltd.