I use this proc to parse a proc's args and allow any parameter to be specified as a switch.
To redefine proc so that all procs are "procargs" enabled:
procargs proc
To "procargs" enable an existing proc
procargs existingprocname
To define a proc with "procargs" enabeled
procargs proc { args } { body }
I also use it as a replacement for getopt and friends. I write the main function of the scripted command as a proc and then eval that proc at the bottom of the file with $argv.
procargs main { parameter list here } {
...
}
eval main $argv