<br class="Apple-interchange-newline">Yes, get rid of quotes. But please introduce either one multi-line syntax or the other (and I prefer just \ at the end of line) and document that use. I'll soon have to write my own implementation compatible with --extra-opts and I don't want to have to support 3 different ways either.<div>

<br><div class="gmail_quote">On Wed, May 30, 2012 at 1:59 PM, Stephan <span dir="ltr"><<a href="mailto:Stephan@quantentunnel.de" target="_blank">Stephan@quantentunnel.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi!<br>
<br>
Holger Weiß asked me to introduce here what I intend to do.<br>
<br>
I lately started to use Nagios::Plugin for a plugin I developed at work.<br>
I came across the --extra-opts parameter and thought that this could be<br>
very helpful.<br>
<br>
Unfortunately I seem to found a bug - or at least - inconsistant behaviour.<br>
<br>
When you pass on commandline something like --opt "test value" you get<br>
in your variable:<br>
     test value<br>
<br>
But if you put into the extra-opts file<br>
     opt="test value"<br>
you get<br>
     "test value"<br>
<br>
Okay, I could live with the plugin not removing the quotes, so I put<br>
into the extra-opts file<br>
     opt=test vale<br>
But guess what I got:<br>
     "test value"<br>
<br>
So N::P is introducing quotes here.<br>
<br>
So my first idea is to get rid of those quotes.<br>
<br>
Unfortunately this will break some of the tests, as they rely on the sub<br>
_cmdline which generates, from the internal options array, a commandline.<br>
<br>
But this sub is, as far as I can see, only used for this test and<br>
nowhere else.<br>
<br>
Additionally the quoting is done wrong or at least for an OS I don't<br>
know as quotes inside the string are not escaped. So this<br>
     opt=a 2.5" hard disc<br>
becomes<br>
     "a 2.5" hard disc"<br>
<br>
So the questions I have are:<br>
1) For what reason was the quoting introduced - except for the tests?<br>
2) For which platform is it intended? For sure no *IX<br>
3) Is it required?<br>
<br>
I'd vote for getting rid of the quoting.<br>
<br>
<br>
My second idea is to introduce multiline values in the extra-opts file.<br>
This would simply be done in the usual way, by putting a backslash "\"<br>
as last charater of the line. All the lines will be concatenated by a<br>
single space after first triming them. So<br>
     opt=multi \<br>
         line \<br>
         value<br>
would become<br>
     multi line value<br>
<br>
Last but not lest I'd like to introduce a HERE-document like syntax in<br>
conformance to Config::General. Example:<br>
     opt=<<HERE<br>
         line 1<br>
         line 2<br>
         line 3<br>
         HERE<br>
would become<br>
     line1\nline 2\nline 3\n<br>
<br>
and, as the amount of whitespace before the end-marker is removed from<br>
all the lines:<br>
     opt=<<HERE<br>
         line 1<br>
             line 2<br>
         line 3<br>
         HERE<br>
would become<br>
     line1\n    line2\nline 3\n<br>
<br>
What do you think about my ideas?<br>
<br>
------------------------------------------------------------------------------<br>
Live Security Virtual Conference<br>
Exclusive live event will cover all the ways today's security and<br>
threat landscape has changed and how IT managers can respond. Discussions<br>
will include endpoint security, mobile security and the latest in malware<br>
threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a><br>
_______________________________________________________<br>
Nagios Plugin Development Mailing List <a href="mailto:Nagiosplug-devel@lists.sourceforge.net">Nagiosplug-devel@lists.sourceforge.net</a><br>
Unsubscribe at <a href="https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel</a><br>
::: Please include plugins version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<br>
</blockquote></div><br></div>