ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] long options again

From: Gisle Vanem <gvanem@xxxxxxxxxxxx>
Date: Tue, 16 Jul 2013 20:06:10 +0200
"Brandon Carpenter" <hashstat@xxxxxxxx> wrote:

I have to say that I dislike getopt() and getopt_long() for option parsing because of the disconnect between the options and the help. It creates multiple places that require updating when options change and quite often, one of those places is forgotten.

Agreed. That's why tools like gengetopt has been developed.
This tool will generate the getopt_long() C-source + the help-text from a .ggo file specifying the program args.
Ref.:
 http://www.gnu.org/software/gengetopt/gengetopt.html

--gv