Re: Useless Use Of Regexes

Liste des GroupesRevenir à ol misc 
Sujet : Re: Useless Use Of Regexes
De : OFeem1987 (at) *nospam* teleworm.us (Chris Ahlstrom)
Groupes : comp.os.linux.misc
Date : 29. Mar 2025, 16:40:49
Autres entêtes
Organisation : None
Message-ID : <vs94a2$1kobq$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
User-Agent : slrn/1.0.3 (Linux)
rbowman wrote this post while blinking in Morse code:

On Fri, 28 Mar 2025 11:42:37 -0400, Chris Ahlstrom wrote:
>
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.
>
I've never used getopt_long() but I find getopt() to be cleaner than DIY
parsing.

My parser accepts an array of option structures specifying the long name, the
character code (if any), the type of data represented by the option,
enabling/disabling of options, the default value, the current value,
a dirty flag, and a description.  It generates color-coded help. It has
common built-in options for help and verbosity, for example. And of
course a number of test apps.

Options can be grouped into sections suitable for read/write from an INI-style
file, complete with descriptions of each section.

It's written in C++, but with a C interface also provided.

During my recent wrestling with getopt_long(), I noticed a couple other
features to cover. 

I'm not claiming anyone other than I will ever want to use it :-)

--
The departing division general manager met a last time with his young
successor and gave him three envelopes.  "My predecessor did this for me,
and I'll pass the tradition along to you," he said.  "At the first sign
of trouble, open the first envelope.  Any further difficulties, open the
second envelope.  Then, if problems continue, open the third envelope.
Good luck."  The new manager returned to his office and tossed the envelopes
into a drawer.
Six months later, costs soared and earnings plummeted. Shaken, the
young man opened the first envelope, which said, "Blame it all on me."
The next day, he held a press conference and did just that.  The
crisis passed.
Six months later, sales dropped precipitously.  The beleaguered
manager opened the second envelope.  It said, "Reorganize."
He held another press conference, announcing that the division
would be restructured.  The crisis passed.
A year later, everything went wrong at once and the manager was
blamed for all of it.  The harried executive closed his office door, sank
into his chair, and opened the third envelope.
"Prepare three envelopes..." it said.

Date Sujet#  Auteur
24 Mar 25 * Useless Use Of Regexes66Lawrence D'Oliveiro
24 Mar 25 +* Re: Useless Use Of Regexes29Pancho
24 Mar 25 i+- Re: Useless Use Of Regexes1The Natural Philosopher
24 Mar 25 i+* Re: Useless Use Of Regexes26Lawrence D'Oliveiro
25 Mar 25 ii+* Re: Useless Use Of Regexes3Marc Haber
26 Mar 25 iii`* Re: Useless Use Of Regexes2Lawrence D'Oliveiro
26 Mar 25 iii `- Re: Useless Use Of Regexes1Marc Haber
25 Mar 25 ii+* Re: Useless Use Of Regexes21Anssi Saari
25 Mar 25 iii`* Re: Useless Use Of Regexes20Marc Haber
26 Mar 25 iii +* Re: Useless Use Of Regexes16Lawrence D'Oliveiro
26 Mar 25 iii i`* Re: Useless Use Of Regexes15Marc Haber
26 Mar 25 iii i `* Re: Useless Use Of Regexes14Lawrence D'Oliveiro
26 Mar 25 iii i  +* Re: Useless Use Of Regexes12Marc Haber
27 Mar 25 iii i  i`* Re: Useless Use Of Regexes11Lawrence D'Oliveiro
27 Mar 25 iii i  i `* Re: Useless Use Of Regexes10Marc Haber
27 Mar 25 iii i  i  `* Re: Useless Use Of Regexes9Lawrence D'Oliveiro
27 Mar 25 iii i  i   `* Re: Useless Use Of Regexes8Marc Haber
27 Mar 25 iii i  i    `* Re: Useless Use Of Regexes7Lawrence D'Oliveiro
28 Mar 25 iii i  i     +* Re: Useless Use Of Regexes5marrgol
28 Mar 25 iii i  i     i+* Re: Useless Use Of Regexes3Chris Ahlstrom
28 Mar 25 iii i  i     ii`* Re: Useless Use Of Regexes2rbowman
29 Mar 25 iii i  i     ii `- Re: Useless Use Of Regexes1Chris Ahlstrom
28 Mar 25 iii i  i     i`- Re: Useless Use Of Regexes1Lawrence D'Oliveiro
1 Apr 25 iii i  i     `- Re: Useless Use Of Regexes1Wayne
27 Mar 25 iii i  `- Re: Useless Use Of Regexes1c186282
26 Mar 25 iii `* Re: Useless Use Of Regexes3c186282
26 Mar 25 iii  `* Re: Useless Use Of Regexes2rbowman
27 Mar 25 iii   `- Re: Useless Use Of Regexes1c186282
25 Mar 25 ii`- Re: Useless Use Of Regexes1Pancho
30 Mar 25 i`- Re: Useless Use Of Regexes1Stéphane CARPENTIER
25 Mar 25 +- Re: Useless Use Of Regexes1Ben Collver
30 Mar 25 `* Re: Useless Use Of Regexes35Stéphane CARPENTIER
30 Mar 25  `* Re: Useless Use Of Regexes34Lawrence D'Oliveiro
30 Mar 25   `* Re: Useless Use Of Regexes33Stéphane CARPENTIER
31 Mar 25    `* Re: Useless Use Of Regexes32Lawrence D'Oliveiro
6 Apr 25     `* Re: Useless Use Of Regexes31Stéphane CARPENTIER
7 Apr 25      `* Re: Useless Use Of Regexes30Lawrence D'Oliveiro
8 Apr 25       +- Re: Useless Use Of Regexes1c186282
8 Apr 25       +* Re: Useless Use Of Regexes21Eli the Bearded
8 Apr 25       i+- Re: Useless Use Of Regexes1c186282
8 Apr 25       i+- Re: Useless Use Of Regexes1Lawrence D'Oliveiro
8 Apr 25       i+* Re: Useless Use Of Regexes17Anssi Saari
9 Apr 25       ii`* Re: Useless Use Of Regexes16Lawrence D'Oliveiro
9 Apr 25       ii +* Re: Useless Use Of Regexes13c186282
9 Apr 25       ii i`* Shell command history (was: Useless Use Of Regexes)12Geoff Clare
12 Apr 25       ii i `* Re: Shell command history (was: Useless Use Of Regexes)11Lawrence D'Oliveiro
13 Apr 25       ii i  +- Re: Shell command history (was: Useless Use Of Regexes)1Eli the Bearded
14 Apr 25       ii i  `* Re: Shell command history9Nuno Silva
14 Apr 25       ii i   `* Re: Shell command history8Lawrence D'Oliveiro
16 Apr 25       ii i    +* Re: Shell command history6Eli the Bearded
16 Apr 25       ii i    i+- Re: Shell command history1Andreas Eder
16 Apr 25       ii i    i`* Re: Shell command history4Lawrence D'Oliveiro
18 Apr 25       ii i    i `* Re: Shell command history3Eli the Bearded
19 Apr 25       ii i    i  `* Re: Shell command history2Lawrence D'Oliveiro
20 Apr 25       ii i    i   `- Re: Shell command history1Eli the Bearded
18 Apr 25       ii i    `- Re: Shell command history1Nuno Silva
9 Apr 25       ii `* Re: Useless Use Of Regexes2Anssi Saari
12 Apr 25       ii  `- Re: Useless Use Of Regexes1Lawrence D'Oliveiro
12 Apr 25       i`- Re: Useless Use Of Regexes1Stéphane CARPENTIER
12 Apr 25       `* Re: Useless Use Of Regexes7Stéphane CARPENTIER
13 Apr 25        `* Re: Useless Use Of Regexes6Lawrence D'Oliveiro
13 Apr 25         +* Re: Useless Use Of Regexes4Stéphane CARPENTIER
14 Apr 25         i`* Re: Useless Use Of Regexes3Lawrence D'Oliveiro
17 Apr 25         i `* Re: Useless Use Of Regexes2Stéphane CARPENTIER
18 Apr 25         i  `- Re: Useless Use Of Regexes1Lawrence D'Oliveiro
13 Apr 25         `- Re: Useless Use Of Regexes1candycanearter07

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal