Wireshark-dev: Re: [Wireshark-dev] extcap command line parameter format

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Thu, 26 Jul 2018 14:46:53 -0700
On Jul 23, 2018, at 11:37 AM, Guy Harris <guy@xxxxxxxxxxxx> wrote:

> On Jul 20, 2018, at 10:12 AM, Jaap Keuter <jaap.keuter@xxxxxxxxx> wrote:
> 
>> Doesn’t this mean that all other command line parameters with values are to be generated with equal sign?
> 
> It's a requirement for any parameter where the value is optional.
> 
> It's not a requirement for any parameter where the value is required.

...so, for any non-Boolean parameter specific to your extcap program, *DO NOT MAKE THE ARGUMENT TO THE OPTION OPTIONAL*.

(For Boolean options, the extcap code either passes the option, *without* an argument, if the parameter is true, or doesn't pass the option at all if the parameter is false, so "optional argument" works, even with the *BSD/macOS getopt_long().)

For example, if you're using getopt_long() to parse your arguments, *DO NOT* use optional_argument for *ANY* non-Boolean options.