[Lazarus] Parsing command line options

Bernd prof7bit at gmail.com
Mon Sep 10 17:59:48 CEST 2012


2012/9/10 J.A. de Vries <hdv.jadev at gmail.com>:

> Might I make a suggestion? Why try and invent the wheel ourselves?
> There's a very good library named getopts that has been used by masses
> of programmers for years now. Maybe we could learn from that and
> re-implement the choices made in there?

But isn't this a completely separate problem? If I understand this
thread correctly then the problem here is properly emulating what the
shell would do when parsing one line of text (splitting the line at
unquoted spaces, removing quotes, maybe even expanding wildcards) and
then *producing* the argv array while getopts on the other hand can be
used to extract key-value pairs that follow a certain syntax from an
already existing argv array?




More information about the Lazarus mailing list