commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jürgen Weber <webe...@hotmail.com>
Subject CLI: ParseException:Unrecognized option: -p
Date Wed, 27 Nov 2002 13:23:56 GMT
Hello,

if I try the test below there is a ParseException I cannot explain. Is my 
code wrong or is there a bug in CLI (1.0) ?

Thanks,
Juergen

java version "1.4.1_01"


C:\lib>java -classpath  .;commons-cli-1.0.jar  CliTest
Commandline ParseException:Unrecognized option: -p

------------------------- CliTest.java ------------
import org.apache.commons.cli.*;

public class CliTest
{

	public static void main(String[] args)
	{
		String[] argus={

		"-pkg","package","-td","../gen","Method.dtd"

		};

		parseCommandline(argus);
	}


	private static void parseCommandline(String[] args)
	{
		String s=null;

		Options tOptions = new Options();

		tOptions.addOption("i", true, "input data folder");
		tOptions.addOption("td", true, "output folder");
		tOptions.addOption("pkg", true, "package");

		CommandLineParser parser = new PosixParser();

		try
		{
			CommandLine line = parser.parse(tOptions, args);
		}
		catch (ParseException exp)
		{
			System.out.println("Commandline ParseException:" + exp.getMessage());
		}

	}
}





_________________________________________________________________
Messenger  -  Wer in Echtzeit kommunizieren will, lädt den MSN Messenger. 
Cool, kostenlos und mit 3D Emoticons: http://messenger.msn.de


--
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