That is I'd like to be able to do this:
proc my_proc_with_arbitrary_args {args} {
set options {
{a "set the atime only"}
{m "set the mtime only"}
{c "do not create non-existent files"}
{r.arg "" "use time from ref_file"}
{t.arg -1 "use specified time"}
}
set usage ": MyCommandName \[options] filename ...\noptions:"
array set params [::cmdline::getoptions args $options $usage]
}
This does not work beacause of hard-coded references to argv0, argv
inside ::cmdline::getopt. Can I work around this issue somehow?
I wrote my own procedure for parsing the cmd-line (even before
I knew ::cmdline::getopt existed) but if there is some standard
argument parsing module I'd be happy to try it.
K.
Within standard tcl, there is the package opt which allows to define
procs with arguments as you asked for.
Unfortunately, there is not much doc. I used the source code in lib/
tclxxx/opt
See also at:
http://wiki.tcl.tk/1539
Hope this helps,
Harald