Re: --extra-opts (was: New Threshold Syntax)

Páll Guðjón Sigurðsson <[email protected]>
Newsgroups gmane.network.nagios.plugins.devel
Message-ID <[email protected]>
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=
--extra-opts=''
--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 :)

Cheers,
Palli



----- Original Message -----
From: "Holger Weiß" <[email protected]>
To: "Nagios Plugins Development" <[email protected]>
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 <[email protected]> [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

	-extra-opts=-jk
vs.
	-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.

Holger

------------------------------------------------------------------------------
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!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________________
Nagios Plugin Development Mailing List [email protected]
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

------------------------------------------------------------------------------
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!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________________
Nagios Plugin Development Mailing List [email protected]
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.