From: Xuan B. <med...@us...> - 2007-04-17 04:02:58
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/cmd In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv3533/src/org/tm4j/topicmap/cmd Modified Files: AppBase.java Log Message: Support for reading arguments from standard input (instead from argument line) in response to feature request https://sourceforge.net/tracker/index.php?func=detail&aid=1698486&group_id=27895&atid=391882 . This is still a hack, but achieves the objective to support unlimited arguments. Index: AppBase.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/cmd/AppBase.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AppBase.java 26 Feb 2004 21:33:44 -0000 1.6 --- AppBase.java 17 Apr 2007 04:02:55 -0000 1.7 *************** *** 24,29 **** --- 24,32 ---- import java.io.IOException; import java.io.OutputStream; + import java.io.BufferedReader; + import java.io.InputStreamReader; import java.util.List; + import java.util.ArrayList; *************** *** 166,169 **** --- 169,190 ---- setupBasicArgs(parser); setupApplicationArgs(parser); + + // Hack to allow a greater number of arguments + if ((args.length==1)&&args[0].equals("--@")) { + try { + BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); + ArrayList<String> argsList = new ArrayList<String>(); + String s; + + while ((s = in.readLine())!=null) { + argsList.add(s); + } + + args = argsList.toArray(new String[0]); + } catch (IOException e) { + throw new RuntimeException("Could not read System.in.",e); + } + } + parser.parse(args); run(parser); *************** *** 270,273 **** --- 291,297 ---- /* * $Log$ + * Revision 1.7 2007/04/17 04:02:55 mediumnet + * Support for reading arguments from standard input (instead from argument line) in response to feature request https://sourceforge.net/tracker/index.php?func=detail&aid=1698486&group_id=27895&atid=391882 . This is still a hack, but achieves the objective to support unlimited arguments. + * * Revision 1.6 2004/02/26 21:33:44 kal_ahmed * Updated license text and reformatted source with Jalopy. |