~sircmpwn/hare-users

5 3

getopts long options

Details
Message ID
<87k03m12ij.fsf@tomsdiner.org>
DKIM signature
pass
Download raw message
Hi,

I’m in the process of developing a drop in replacement for a tool; for that I need long options.

I searched through the archives (hare-dev, hare-users) and tickets for ’getopt’ and ’getopt long’ without success. I
assume the decision to not support GNU style long options is intentional to keep everything as concise as possible. Is
this assumption correct? Or would an extension to support this be welcome? I’m going to write this anyway, the question
is - just as module, as ext-lib or in stdlib?

kind regards, Tom
Details
Message ID
<COJJMKYOKATA.M5IOFO9BXIK2@monch>
In-Reply-To
<87k03m12ij.fsf@tomsdiner.org> (view parent)
DKIM signature
pass
Download raw message
Yes, this is intentional.
Details
Message ID
<COJL7ISEFQFX.3C1Z957SX1KDD@taiga>
In-Reply-To
<COJJMKYOKATA.M5IOFO9BXIK2@monch> (view parent)
DKIM signature
pass
Download raw message
The getopt module is compatible with POSIX. An argument parser
supporting long options would mkae for a good external library, but not
in the extlib, just in the broader ecosystem at large.
Details
Message ID
<COJTLAKUY6X9.WREYBDDY2UZJ@archlinux-white>
In-Reply-To
<COJL7ISEFQFX.3C1Z957SX1KDD@taiga> (view parent)
DKIM signature
pass
Download raw message
On Wed Nov 23, 2022 at 5:02 AM EST, Drew DeVault wrote:
> The getopt module is compatible with POSIX.

Why is POSIX compatibility relevent in this case, and what does
compatibility mean exactly in this context? It is good for C programs to
write to POSIX standards to ensure interoperability between platforms.
But Hare programs only need to worry about writing to the standard
library, which (presumably) is going to be the same on every platform it
is present. The way that the getopt module is used is already very
different from how getopt(3p) is used. There may be an argument for
keeping the getopt module minimal, but I don't think that "POSIX
compatibility" is one of them.
Details
Message ID
<COJTPOEQMFO4.28GDUC5R9VGPP@megumin>
In-Reply-To
<COJTLAKUY6X9.WREYBDDY2UZJ@archlinux-white> (view parent)
DKIM signature
pass
Download raw message
We like having a standard to point at to establish some kind of
precedent. The CLI interface it describes is still something that we
can (and do) conform to, but Hare is not C so naturally the Hare API
need not resemble the C API.
Details
Message ID
<COJTS0BIBFK6.1EBCQELHYWZMC@archlinux-white>
In-Reply-To
<COJTPOEQMFO4.28GDUC5R9VGPP@megumin> (view parent)
DKIM signature
pass
Download raw message
I understand, thanks.
Reply to thread Export thread (mbox)