John Keyes wrote:

I don't see any obvious errors. Can you write the test
in plain java and see if that works. If not then post
the class here and I'll have a look at it. Sorry for the abruptness but I am busy at the moment.

Jython is an interpretor written in java, so the behavior of the test will be the same in java... That's said, I wrote my test in plain java, and the exception is the same...

java FooMain -url http://foo.com
usage: java FooMain
-url <myurl> an url
Exception in thread "main" org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: -u
at org.apache.commons.cli.Parser.processOption(Parser.java:253)
at org.apache.commons.cli.Parser.parse(Parser.java:170)
at org.apache.commons.cli.Parser.parse(Parser.java:114)
at FooMain.main(FooMain.java:16)



The java file is attached...


thanks in advance

Fred

--
XPath free testing software :  http://lantern.sourceforge.net
Fr�d�ric Laurent                     http://www.opikanoba.org
import org.apache.commons.cli.*;

public class FooMain {
	  public static void main( String[] args ) throws Exception {

		Options options = new Options();
  	OptionBuilder.withArgName("myurl");
  	OptionBuilder.hasArg();
  	OptionBuilder.withDescription("an url");
  	options.addOption(OptionBuilder.create("url"));
		
		HelpFormatter formatter = new HelpFormatter();
  	formatter.printHelp("java FooMain", options );
		
  	CommandLineParser parser = new PosixParser();
 		CommandLine line = parser.parse( options, args );
		String url = line.getOptionValue("url");
		System.out.println("url parameter : "+url);
		}
}


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to