[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handling getopt for option without optional argument value

From: Greg Wooledge
Subject: Re: Handling getopt for option without optional argument value
Date: Fri, 23 Jul 2021 13:57:45 -0400

On Fri, Jul 23, 2021 at 07:35:36PM +0200, wrote:
> An Gnu has already implemented long options in programs before, how does it 
> seem such
> insurmountable obstacle asking if people can use long options ?

Find a GNU program written in bash (or in sh) and see how they do it.
If you like how they do it, copy their parser and use it in your

If you don't like how they do it, find another way.

I believe you will find that the GNU project is quite big on portability,
and that they won't be using the Linux-only getopt program.  Remember,
the GNU project started long before Linux existed, and one of its early
strategies was to write drop-in replacements for the Unix command set.
GNU programs therefore need to work on as many different flavors of Unix
as possible, with as few disruptions as possible.

If GNU had written a getopt program, it would certainly be compatible
with the Unix version.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]