After digging a little further, the exception appears to be coming from the 
following method...

org.apache.aries.blueprint.container.AggregateConverter::convertFromString(value,
 toType, loader)

and it does seem that a trim() would be a good defensive move in this case.

-----Original Message-----
From: Brad Beck [mailto:[email protected]]
Sent: Thursday, February 17, 2011 3:31 PM
To: [email protected]
Subject: RE: Passing negative integer as first command parameter...

That gets me closer, but now I get the following error...

Error executing command pfm:range: unable to convert argument rangeStart with 
value ' -1' to type java.lang.Integer

This appears to be coming from inside 
org.apache.aries.blueprint.container.AggregateConverter.

It seems like a trim() prior to conversion might make it work...

-----Original Message-----
From: Guillaume Nodet [mailto:[email protected]]
Sent: Thursday, February 17, 2011 2:50 PM
To: [email protected]
Subject: Re: Passing negative integer as first command parameter...

Good question.  Not really sure actually.  Can you try
> range ' -1' 10
with a space between the first quote and the minus sign ?

On Thu, Feb 17, 2011 at 20:15, Brad Beck <[email protected]> wrote:
> How do I escape the first parameter to a command when it is a negative number 
> (e.g. range -1 10)?
>
> I'm currently getting the following error when I try the example above (Karaf 
> 2.1.0)...
>
> Error executing command pfm:range undefined option -1
>
> -Brad Beck
>
>
>



--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Reply via email to