[Nagiosplug-devel] --extra-opts

Holger Weiß holger at cis.fu-berlin.de
Wed Sep 4 14:40:26 CEST 2013

* Páll Guðjón Sigurðsson <palli at ok.is> [2013-09-04 12:18]:
> Python's optparse does not support optional arguments and you are right,
> if what follows extra-opts is an option (like -jk) its easy to make an
> educated guess. However the spec said that extra-opts can be specified
> anywhere on the command-line and consider the following scenario:
> # check_stuff --extra-opts host.example.com
> In the above example its impossible to tell if "host.example.com" is a
> section name or an argument to the plugin.

I agree this case is less obvious if you're not used to GNU getopt(3)'s
semantics (where optional arguments "must be written directly after the
long option name, separated by '=', if present"¹).

> For that reason, i'd like to propose that the spec removes the reference
> to --extra-opts without arguments and instead assumed the following
> (which are all fairly standard) to achieve the same effect.
> --extra-opts=
> --extra-opts=''
> --extra-opts ''

Fine with me, but I'm not the --extra-opts guy.  Thomas, any comments?


¹ http://man7.org/linux/man-pages/man1/getopt.1.html

More information about the Devel mailing list