theOptions.add(new Option(token.charAt(1))); theOptions.add(new Option(token.charAt(j))); indexoflast = theOptions.size()-1; Option op = (Option)theOptions.get(indexoflast); char opLetter = op.getArgLetter(); if(!op.hasArg() && theOptionMatcher.hasArg(opLetter)){ op.setArg(token);
if(theOptionsIterator.hasNext()){ theCurrentOption = (Option)theOptionsIterator.next(); char c = theCurrentOption.getArgLetter(); boolean shouldHaveArg = theOptionMatcher.hasArg(c); String arg = theCurrentOption.getArgument(); if(!theOptionMatcher.match(c)) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
theOptions.add(new Option(token.charAt(1))); theOptions.add(new Option(token.charAt(j))); indexoflast = theOptions.size()-1; Option op = (Option)theOptions.get(indexoflast); char opLetter = op.getArgLetter(); if(!op.hasArg() && theOptionMatcher.hasArg(opLetter)){ op.setArg(token);
theOptions.add(new Option(token.charAt(1))); theOptions.add(new Option(token.charAt(j))); indexoflast = theOptions.size()-1; Option op = (Option)theOptions.get(indexoflast); char opLetter = op.getArgLetter(); if(!op.hasArg() && theOptionMatcher.hasArg(opLetter)){ op.setArg(token);
theOptions.add(new Option(token.charAt(1))); theOptions.add(new Option(token.charAt(j))); indexoflast = theOptions.size()-1; Option op = (Option)theOptions.get(indexoflast); char opLetter = op.getArgLetter(); if(!op.hasArg() && theOptionMatcher.hasArg(opLetter)){ op.setArg(token);
if(theOptionsIterator.hasNext()){ theCurrentOption = (Option)theOptionsIterator.next(); char c = theCurrentOption.getArgLetter(); boolean shouldHaveArg = theOptionMatcher.hasArg(c); String arg = theCurrentOption.getArgument(); if(!theOptionMatcher.match(c)) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
if(theOptionsIterator.hasNext()){ theCurrentOption = (Option)theOptionsIterator.next(); char c = theCurrentOption.getArgLetter(); boolean shouldHaveArg = theOptionMatcher.hasArg(c); String arg = theCurrentOption.getArgument(); if(!theOptionMatcher.match(c)) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
if(theOptionsIterator.hasNext()){ theCurrentOption = (Option)theOptionsIterator.next(); char c = theCurrentOption.getArgLetter(); boolean shouldHaveArg = theOptionMatcher.hasArg(c); String arg = theCurrentOption.getArgument(); if(!theOptionMatcher.match(c)) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
/** * gets the argument for the current parsed option. For example, * in case of '-d <file>', if current option parsed is 'd' then * getOptionArg() would return '<file>'. * @return String - argument for current parsed option. */ public String getOptionArg(){ String retval = null; String tmp = theCurrentOption.getArgument(); char c = theCurrentOption.getArgLetter(); if(theOptionMatcher.hasArg(c)){ retval = tmp; } return retval; }
/** * gets the argument for the current parsed option. For example, * in case of '-d <file>', if current option parsed is 'd' then * getOptionArg() would return '<file>'. * @return String - argument for current parsed option. */ public String getOptionArg(){ String retval = null; String tmp = theCurrentOption.getArgument(); char c = theCurrentOption.getArgLetter(); if(theOptionMatcher.hasArg(c)){ retval = tmp; } return retval; }
/** * debugging routine to print out all options collected */ public void printOptions(){ for(ListIterator it=theOptions.listIterator(); it.hasNext();){ Option opt = (Option)it.next(); System.out.print("OPT =" + opt.getArgLetter()); String arg = opt.getArgument(); if(arg != null){ System.out.print(" " + arg); } System.out.println(); } }
/** * gets the argument for the current parsed option. For example, * in case of '-d <file>', if current option parsed is 'd' then * getOptionArg() would return '<file>'. * @return String - argument for current parsed option. */ public String getOptionArg(){ String retval = null; String tmp = theCurrentOption.getArgument(); char c = theCurrentOption.getArgLetter(); if(theOptionMatcher.hasArg(c)){ retval = tmp; } return retval; }
/** * debugging routine to print out all options collected */ public void printOptions(){ for(ListIterator it=theOptions.listIterator(); it.hasNext();){ Option opt = (Option)it.next(); System.out.print("OPT =" + opt.getArgLetter()); String arg = opt.getArgument(); if(arg != null){ System.out.print(" " + arg); } System.out.println(); } }
/** * debugging routine to print out all options collected */ public void printOptions(){ for(ListIterator it=theOptions.listIterator(); it.hasNext();){ Option opt = (Option)it.next(); System.out.print("OPT =" + opt.getArgLetter()); String arg = opt.getArgument(); if(arg != null){ System.out.print(" " + arg); } System.out.println(); } }
/** * gets the argument for the current parsed option. For example, * in case of '-d <file>', if current option parsed is 'd' then * getOptionArg() would return '<file>'. * @return String - argument for current parsed option. */ public String getOptionArg(){ String retval = null; String tmp = theCurrentOption.getArgument(); char c = theCurrentOption.getArgLetter(); if(theOptionMatcher.hasArg(c)){ retval = tmp; } return retval; }
/** * debugging routine to print out all options collected */ public void printOptions(){ for(ListIterator it=theOptions.listIterator(); it.hasNext();){ Option opt = (Option)it.next(); System.out.print("OPT =" + opt.getArgLetter()); String arg = opt.getArgument(); if(arg != null){ System.out.print(" " + arg); } System.out.println(); } }