Mail Archive Home | fractal-commits List | August 2008 Index
| <-- Date Index --> | <-- Thread Index --> |
Ignore upper/lower cases for command line arguments.
--- trunk/juliac/compiler/src/main/java/org/objectweb/fractal/juliac/CmdLineArgs.java 2008-08-28 12:32:33 UTC (rev 8403)
+++ trunk/juliac/compiler/src/main/java/org/objectweb/fractal/juliac/CmdLineArgs.java 2008-08-28 17:21:12 UTC (rev 8404)
@@ -1,6 +1,6 @@
/***
* Juliac
- * Copyright (C) 2007 INRIA, France Telecom, USTL
+ * Copyright (C) 2007-2008 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -16,7 +16,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * Contact: Lionel.Seinturier@xxxxxxx
+ * Contact: Lionel.Seinturier@xxxxxxxxxxxxxx
*
* Author: Lionel Seinturier
*/
@@ -37,7 +37,7 @@
* Options and flags are supposed to be string starting with two minus
* characters. Options are followed by a value.
*
- * @author Lionel Seinturier <Lionel.Seinturier@xxxxxxx>
+ * @author Lionel Seinturier <Lionel.Seinturier@xxxxxxxxxxxxxx>
* @since 1.2
*/
public class CmdLineArgs<F extends Enum<F>,O extends Enum<O>> {
@@ -115,24 +115,25 @@
public void parse( String[] args ) throws IllegalArgumentException {
for (int i = 0; i < args.length; i++) {
- String key = args[i];
+ String arg = args[i];
+ String key = arg.toLowerCase();
if( flags.contains(key) ) {
values.put(key,null);
}
else if( options.contains(key) ) {
if( i == args.length-1 ) {
- String msg = "Missing value for option "+key;
+ String msg = "Missing value for option: "+arg;
throw new IllegalArgumentException(msg);
}
i++;
- values.put(key, args[i]);
+ values.put(key,args[i]);
}
else if( key.charAt(0) == '-' ) {
- String msg = "Illegal option: "+key;
+ String msg = "Illegal option: "+arg;
throw new IllegalArgumentException(msg);
}
else {
- files.add(key);
+ files.add(arg);
}
}
}
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 2006-2007, OW2 Consortium | contact | webmaster.