help-bash
[Top][All Lists]
Advanced

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

Handling getopt for option without optional argument value


From: lisa-asket
Subject: Handling getopt for option without optional argument value
Date: Fri, 23 Jul 2021 21:27:30 +0200 (CEST)

From: Dennis Williamson <dennistwilliamson@gmail.com>
To: help-bash <help-bash@gnu.org>
Subject: Re: Handling getopt for option without optional argument value
Date: 23/07/2021 21:14:02 Europe/Paris

On Fri, Jul 23, 2021, 1:43 PM Greg Wooledge <greg@wooledge.org> wrote:

>
>
> The "-xyz to -x -y -z" unrolling that getopt does is fundamentally
> incompatible with the -findopts option style. There's no way to tell
> whether -bar is meant to be one option, or three options.
>

The only way this could be handled would be to check for long option
matches first then unroll the ones that didn't have matches. Still prone to
ambiguities, errors and confusion.

---

I can see that a posix compliant capability that includes long options requires 
more than

one brain.  Start with something, than handle remaining problems as other did 
into the 

code.





reply via email to

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