Re: --extra-opts

Holger Weiß <[email protected]>
Newsgroups gmane.network.nagios.plugins.devel
Organization Freie Universität Berlin
Message-ID <[email protected]>
* Páll Guðjón Sigurðsson <[email protected]> [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?

Holger

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

------------------------------------------------------------------------------
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 Nagiosplug-devel-5NWGOfrQmneRv+LV9MX5upmplPMkL2fr@public.gmane.orget
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.