Hey, I find the cmdline library particularly useful for
script writing. I usually define a custom
getFunctionsOpts routine that is a slight twist on the
getKnownOptions routine (no support for -?/-h/-help)
for new Tcl projects. The attached cmdline.tcl file
contains the getFunctionOptions procedure -- I would
like to submit this as a feature request for the next
release of tcllib.
Thanks for all the great utils!
-Ian Chesal
Modified cmdline.tcl that includes cmdline::getFunctionOptions
Logged In: YES
user_id=75003
I will have a look, but no promises. Why is the removal of
the -h support so important ? Was it replaced with something
else ? Or just an error message ?
Logged In: YES
user_id=82268
The attached code doesn't do anything if unexpected options
are encountered. It just shuffles them into the $argv
variable like it does with non-option arguments. It's much
easier to use this in proc's than the other parser because
you don't want procs to print help information if they get
bad options -- you want the proc to decide what to do,
usually thats just returning an error message.