Vector<String> announceURLs = (Vector<String>) parser.getOptionValues(announce); String[] otherArgs = parser.getRemainingArgs();
Integer.valueOf(Tracker.DEFAULT_TRACKER_PORT)); String[] otherArgs = parser.getRemainingArgs();
int seedTimeValue = (Integer) parser.getOptionValue(seedTime, -1); String[] otherArgs = parser.getRemainingArgs(); if (otherArgs.length != 1) { usage(System.err);
String[] otherArgs = myOptions.getRemainingArgs(); System.out.println("remaining args: "); for ( int i = 0; i<otherArgs.length; ++i ) {
public static void main( String[] args ) { CmdLineParser parser = new CmdLineParser(); CmdLineParser.Option date = parser.addOption(new ShortDateOption('d', "date")); try { parser.parse(args); } catch ( CmdLineParser.OptionException e ) { System.err.println(e.getMessage()); printUsage(); System.exit(2); } // Extract the values entered for the various options -- if the // options were not specified, the corresponding values will be // null. Date dateValue = (Date)parser.getOptionValue(date); // For testing purposes, we just print out the option values System.out.println("date: " + dateValue); // Extract the trailing command-line arguments ('a_number') in the // usage string above. String[] otherArgs = parser.getRemainingArgs(); System.out.println("remaining args: "); for ( int i = 0; i < otherArgs.length; ++i ) { System.out.println(otherArgs[i]); } // In a real program, one would pass the option values and other // arguments to a function that does something more useful. System.exit(0); }
cmdLineParser.parse(args); String encoding = (String) cmdLineParser.getOptionValue(charsetOption); String[] remainingArgs = cmdLineParser.getRemainingArgs(); if (remainingArgs.length != 2) { printUsage("Input and output file are not specified correctly. ");
String[] fileArgs = parser.getRemainingArgs();
String[] fileArgs = parser.getRemainingArgs(); String inputFilename = null;
String[] otherArgs = parser.getRemainingArgs();
String[] fileArgs = parser.getRemainingArgs(); String type = (String) parser.getOptionValue(typeOpt);
String[] otherArgs = parser.getRemainingArgs(); System.out.println("remaining args: "); for ( int i = 0; i < otherArgs.length; ++i ) {
if (parser.getRemainingArgs().length != 1) { printUsage(); System.exit(2); streamConnection.addStreamListener(this); streamConnection.connect(host, port, username, password); startRecording(parser.getRemainingArgs()[0], host, port, username, password); ConsoleReader reader = new ConsoleReader(); Thread t = new Thread(reader); return parser.getRemainingArgs();
this.fileArgsOpt = parser.getRemainingArgs();
this.fileArgsOpt = parser.getRemainingArgs();