|
| From: | Chet Ramey |
| Subject: | Re: Handling getopt for option without optional argument value |
| Date: | Fri, 23 Jul 2021 12:33:08 -0400 |
| User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 |
On 7/23/21 11:43 AM, Greg Wooledge wrote:
The getopts (note the 's') builtin command replaces getopt, and is not broken. Use that instead. Or, if you need to handle --gnu-long-opts or -findopts, write your own option parser. Or don't write the program in bash in the first place. Or STOP FEELING THAT YOU NEED --gnu-long-opts or -findopts in your program. Just... don't do it. People make their own lives SO much more complicated than they need to be. I don't understand why.
To be fair, you don't know their full requirements. It's all about fitting
the tool to your requirements.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
| [Prev in Thread] | Current Thread | [Next in Thread] |