Open Source Software: Projects
Cmdargs
Cmdargs is a Tcl extension that provides a command-line interface for any user-defined proc.
Procs having several arguments—especially optionals—benefit most from cmdargs. Consider this proc:
Calling T could go something like:
It gets hard to keep track of the order of inputs, and tedious to have to restate defaults when entering the last optional values (in this case, "f"). Much better to do this:
Note that values for "d" and "e" don't have to be repeated—the defaults are applied automatically. Furthermore, the order of options in the command-line doesn't matter, variables will still be set correctly.
Easy to use
Cmdargs is invoked as follows:
Values are typed, as boolean, numeric, string or enumerated. (Enumerated means input values are restricted to "legal" values. Which are the values included in the default list.). This provides a useful sanity check on input values, reduces errors and potentially improves performance.
The jWebTools page has good information on using the cmdargs interface.
Information and download
Binaries and source code are available here: Fossil repository
Direct link to the download page: Downloads
Installing and full documentation: Documentation