Sujet : Re: support for built-in -opt style options for proc
De : rich (at) *nospam* example.invalid (Rich)
Groupes : comp.lang.tclDate : 25. Jun 2024, 23:21:12
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v5ffso$1oiln$1@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
et99 <
et99@rocketship1.me> wrote:
On 6/25/2024 9:20 AM, Rich wrote:
et99 <et99@rocketship1.me> wrote:
snip
There is also, in tcllib, the 'cmdline' package:
https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/modules/cmdline/cmdline.md
Which provides an options parser that is very similar (although not
100% identical) to the GNU C 'getopt' options parser. And the man
page has an example.
It looks like a recipe for a unix command line, not so much a tcl command.
That is likely its intent, but one can use it to parse the "args" list
of a proc in the same way one can use it to parse the argv list of CLI
options. Quite a few other tcllib modules use it for their "command
arguments" parsing (all of which are not unix cli commands, but various
Tcl procs).