commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bob mcwhirter <...@werken.com>
Subject Re: [CLI] multiple args
Date Fri, 14 Jun 2002 04:33:35 GMT
On Thu, 13 Jun 2002, Michael A. Smith wrote:

> On Fri, 14 Jun 2002, bob mcwhirter wrote:
> > > > Any thoughts on how to hack in multiple-instances-single-arg options
> > > > without adding yet-another-boolean-parameter to all of the signatures?
> > > 
> > > How about an "end-of-list" marker:
> > > 
> > > maven -D macen.username=werken -- maven:deploy-site
> > 
> > While technically a good solution, it breaks compatibility with other
> > tools such as javac, ant, make, and most any other compiler out there.
> 
> except that I don't think any of those allow arbitrary number of 
> options unless they are last on the command line.  Most options take 
> only a single argument and when they take multiple you're usually stuck 
> with specifying the option multiple times, once per argument.  So, I'm 
> not exactly sure how its not compatible.

No, that's exactly what I want.

I'd be happy if I had to do this:

	maven -Done -Dtwo -Dthree=value myTarget

That'd be just dandy by me.

Basically, just trying to reproduce javac's -D flag.

javac doesn't allow

	javac -D one two three=value MyClass

and it doesn't require

	javac MyClass -D one two three=value 

		or

	javac -D one two three=value -- MyClass

but, it does allow/require

	javac -Done -Dtwo -Dthree=value MyClass


And that's what I want.

> I'm not sure how much Ant's command-line interface has changed since I
> last did much in-depth playing with Ant, but from what I remember their
> command syntax was similar to this:
> 
>   ant [options] target [target ...]
> 
> None of the options allowed more than one argument, 

You're right.  But, you can specify the -D multiple times on the command-line.

> Maybe I need to look more into CLI -- I might be missing something...  
> it's been on my todo list for way too long now.  :)

Yah know, maybe I do too.  I was thinking that if I said 'false' to 
allowMultipleArgs parameter that I could only use -D once on the
command-line.  Maybe not.  I'll go experiment.

	-bob


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message