nstcl-core, part of nstcl, includes commands to parse arguments and define procedures
[http://nstcl.sourceforge.net/docs/nstcl-core/%|%official reference]
ad_proc[L1 ] command makes handling optional switches to procs easy.