[Nagiosplug-devel] --extra-opts (was: New Threshold Syntax)

Páll Guðjón Sigurðsson palli at ok.is
Wed Sep 4 14:18:25 CEST 2013

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.

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 ''

I have no problem with current implementations that support the optional argument, but it feels quite quirky to me, and should be considered a "hidden feature" in current implementations :)


----- Original Message -----
From: "Holger Weiß" <holger at cis.fu-berlin.de>
To: "Nagios Plugins Development" <nagiosplug-devel at lists.sourceforge.net>
Sent: Wednesday, September 4, 2013 12:04:44 PM
Subject: [Nagiosplug-devel] --extra-opts (was: New Threshold Syntax)

* Páll Guðjón Sigurðsson <palli at ok.is> [2013-09-03 13:55]:
> 1) By observing the examples it seems the following is allowed:
> # ./check_stuff --extra-opts=@/etc/myconfig.ini
> # ./check_stuff --extra-opts -jk --some-other-opt
> The latter one causes confusing ambiguity and its not supported by
> python's OptionParser.

Just to clarify: the ambiguity is about

	-jk --extra-opts

and the thing not supported by Python's OptionParser is options that
take an optional argument?

I would've thought that "--extra-opts -jk" is quite obviously meant to
be equivalent to "-jk --extra-opts"; but if your parser doesn't support
this, that's of course a major problem.  Hmm.


Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
Nagios Plugin Development Mailing List Nagiosplug-devel at lists.sourceforge.net
Unsubscribe at https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
::: Please include plugins version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null

More information about the Devel mailing list