Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Chris Ahlstrom Newsgroups: comp.os.linux.misc Subject: Re: Useless Use Of Regexes Date: Fri, 28 Mar 2025 11:42:37 -0400 Organization: None Lines: 36 Message-ID: References: Reply-To: OFeem1987@teleworm.us MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 28 Mar 2025 16:42:38 +0100 (CET) Injection-Info: dont-email.me; posting-host="10262458d48c8fe7aeaeb69f30732ec6"; logging-data="3138408"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19G+Xd2nLhEjelPSKkTaKSr" User-Agent: slrn/1.0.3 (Linux) Cancel-Lock: sha1:Phj0cXCIdAWLE0tP61XvKebWP/E= X-User-Agent: Microsoft Outl00k, Usenet K00k Editions X-Face: 63n<76,LYJQ2m#'5YL#.T95xqyPiG`ffIP70tN+j"(&@6(4l\7uL)2+/-r0)/9SjZ`qw= Njn mr93Xrerx}aQG-Ap5IHn"xe;`5:pp"$RH>Kx_ngWw%c\+6qSg!q"41n2[.N/;Pu6q8?+Poz~e A9? $6_R7cm.l!s8]yfv7x+-FYQ|/k X-Mutt: The most widely-used MUA X-Slrn: Why use anything else? Bytes: 2743 marrgol wrote this post while blinking in Morse code: > On 2025-03-27 at 22:05 Lawrence D'Oliveiro wrote: >>>>> You could have it easier with getopt ... >>>> >>>> Last I checked, getopt doesn’t do long options. >>> >>> You should check again. >> >> ldo@theon:~> help getopt >> getopts: getopts optstring name [arg ...] >> […] > > You're quoting help to 'getopts' shell built-in command -- > you are mistaking it for 'getopt' program from util-linux. $ man getopt_long getopt(3) Library Functions Manual getopt(3) NAME getopt, getopt_long, getopt_long_only, optarg, optind, opterr, optopt - Parse command-line options The getopt family is a pain in the ass. I wrote my own command-line parsing, though I do not use it in legacy apps. -- Overcoming Water overcomes the stone; Without substance it requires no opening; This is the benefit of taking no action. Yet benefit without action, And experience without abstraction, Are practiced by very few. -- Lao Tse, "Tao Te Ching"