commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Tripp" <dtr...@mdisolutions.com>
Subject RE: [cli] method to convert a string (which is a whole command line) into an array (of arguments)
Date Thu, 03 Apr 2008 16:26:54 GMT
No, I didn't.  It seemed too hard.  I would rather use the 100 lines of code
I got from Eclipse!  (in org.eclipse.debug.core.DebugPlugin$ArgumentParser.)

This thread seems useless now.  Thank you all for your time.
 

-----Original Message-----
From: jcarman@carmanconsulting.com [mailto:jcarman@carmanconsulting.com] On
Behalf Of James Carman
Sent: April 3, 2008 11:11 AM
To: Jakarta Commons Users List
Subject: Re: [cli] method to convert a string (which is a whole command
line) into an array (of arguments)

Interesting requirements! :)  Anyway, have you tried using regex?  I played
around a bit in my regex plugin for IntelliJ IDEA and a simple regex like:

"\\w+|\"(.+)\"|'(.+)'"

worked for some simple tests that I tried.  You would probably have to tweak
it a bit.


On Thu, Apr 3, 2008 at 11:48 AM, Daniel Tripp <dtripp@mdisolutions.com>
wrote:
> Well, pass it to Runtime.exec(), yes.
>
>
>
>  -----Original Message-----
>  From: jcarman@carmanconsulting.com 
> [mailto:jcarman@carmanconsulting.com] On  Behalf Of James Carman
>
> Sent: April 3, 2008 10:42 AM
>  To: Jakarta Commons Users List
>  Subject: Re: [cli] method to convert a string (which is a whole 
> command
>  line) into an array (of arguments)
>
>
>
> So, are you looking to have your user enter a command line and then 
> you're  going to split it yourself and pass that to a static 
> main(String[] args)  method?
>
>  On Thu, Apr 3, 2008 at 11:38 AM, Daniel Tripp 
> <dtripp@mdisolutions.com>
>  wrote:
>  > > Which OS(es) are you targetting?
>  >
>  >  Various Windowses, various *nixes.
>  >
>  >
>  >  > So are you looking to emulate that?
>  >
>  >  Right.
>  >
>  >
>  >  > In which case, perhaps the Harmony project has some code that 
> will  > do what  you want.
>  >
>  >  I can't see anything in Harmony that does this, because Harmony 
> just  > implements the standard java.* etc. classes, correct?
>  >
>  >  Environment variables are another consideration, yes.
>  >
>  >  Really I was expecting other people to have run into this same  > 
> problem too,  and hoping they would chime in.  I guess not.
>  >
>  >
>  >
>  >
>  >
>  >  
> ---------------------------------------------------------------------
>  >  To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>  >  For additional commands, e-mail: user-help@commons.apache.org  >  
> >
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>  For additional commands, e-mail: user-help@commons.apache.org
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>  For additional commands, e-mail: user-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message