@Override void handleOption( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions, String detectedArgument ) { detectedOptions.add( this ); }
@Override void handleOption( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions, String detectedArgument ) { detectedOptions.add( this ); }
@Override void handleOption( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions, String detectedArgument ) { detectedOptions.add( this ); }
@Override void handleOption( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions, String detectedArgument ) { detectedOptions.add( this ); }
@Override void handleOption( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions, String detectedArgument ) { detectedOptions.add( this ); }
private void handleOptionArgument( OptionParser parser, OptionSet detectedOptions, ArgumentList arguments ) { if ( parser.posixlyCorrect() ) { detectedOptions.add( this ); parser.noMoreOptions(); } else addArguments( detectedOptions, arguments.next() ); } }
private void handleOptionArgument( OptionParser parser, OptionSet detectedOptions, ArgumentList arguments ) { if ( parser.posixlyCorrect() ) { detectedOptions.add( this ); parser.noMoreOptions(); } else addArguments( detectedOptions, arguments.next() ); } }
private void handleOptionArgument( OptionParser parser, OptionSet detectedOptions, ArgumentList arguments ) { if ( parser.posixlyCorrect() ) { detectedOptions.add( this ); parser.noMoreOptions(); } else addArguments( detectedOptions, arguments.next() ); } }
private void handleOptionArgument( OptionParser parser, OptionSet detectedOptions, ArgumentList arguments ) { if ( parser.posixlyCorrect() ) { detectedOptions.add( this ); parser.noMoreOptions(); } else addArguments( detectedOptions, arguments.next() ); } }
private void handleOptionArgument( OptionParser parser, OptionSet detectedOptions, ArgumentList arguments ) { if ( parser.posixlyCorrect() ) { detectedOptions.add( this ); parser.noMoreOptions(); } else addArguments( detectedOptions, arguments.next() ); } }
@Override protected void detectOptionArgument( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions ) { if ( arguments.hasMore() ) { String nextArgument = arguments.peek(); if ( !parser.looksLikeAnOption( nextArgument ) ) handleOptionArgument( parser, detectedOptions, arguments ); else if ( isArgumentOfNumberType() && canConvertArgument( nextArgument ) ) addArguments( detectedOptions, arguments.next() ); else detectedOptions.add( this ); } else detectedOptions.add( this ); }
@Override protected void detectOptionArgument( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions ) { if ( arguments.hasMore() ) { String nextArgument = arguments.peek(); if ( !parser.looksLikeAnOption( nextArgument ) ) handleOptionArgument( parser, detectedOptions, arguments ); else if ( isArgumentOfNumberType() && canConvertArgument( nextArgument ) ) addArguments( detectedOptions, arguments.next() ); else detectedOptions.add( this ); } else detectedOptions.add( this ); }
@Override protected void detectOptionArgument( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions ) { if ( arguments.hasMore() ) { String nextArgument = arguments.peek(); if ( !parser.looksLikeAnOption( nextArgument ) ) handleOptionArgument( parser, detectedOptions, arguments ); else if ( isArgumentOfNumberType() && canConvertArgument( nextArgument ) ) addArguments( detectedOptions, arguments.next() ); else detectedOptions.add( this ); } else detectedOptions.add( this ); }
@Override protected void detectOptionArgument( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions ) { if ( arguments.hasMore() ) { String nextArgument = arguments.peek(); if ( !parser.looksLikeAnOption( nextArgument ) && canConvertArgument( nextArgument ) ) handleOptionArgument( parser, detectedOptions, arguments ); else if ( isArgumentOfNumberType() && canConvertArgument( nextArgument ) ) addArguments( detectedOptions, arguments.next() ); else detectedOptions.add( this ); } else detectedOptions.add( this ); }
@Override protected void detectOptionArgument( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions ) { if ( arguments.hasMore() ) { String nextArgument = arguments.peek(); if ( !parser.looksLikeAnOption( nextArgument ) && canConvertArgument( nextArgument ) ) handleOptionArgument( parser, detectedOptions, arguments ); else if ( isArgumentOfNumberType() && canConvertArgument( nextArgument ) ) addArguments( detectedOptions, arguments.next() ); else detectedOptions.add( this ); } else detectedOptions.add( this ); }
/** * Parses the given command line arguments according to the option specifications given to the parser. * * @param arguments arguments to parse * @return an {@link OptionSet} describing the parsed options, their arguments, and any non-option arguments found * @throws OptionException if problems are detected while parsing * @throws NullPointerException if the argument list is {@code null} */ public OptionSet parse( String... arguments ) { ArgumentList argumentList = new ArgumentList( arguments ); OptionSet detected = new OptionSet( recognizedOptions.toJavaUtilMap() ); detected.add( recognizedOptions.get( NonOptionArgumentSpec.NAME ) ); while ( argumentList.hasMore() ) state.handleArgument( this, argumentList, detected ); reset(); ensureRequiredOptions( detected ); ensureAllowedOptions( detected ); return detected; }
/** * Parses the given command line arguments according to the option specifications given to the parser. * * @param arguments arguments to parse * @return an {@link OptionSet} describing the parsed options, their arguments, and any non-option arguments found * @throws OptionException if problems are detected while parsing * @throws NullPointerException if the argument list is {@code null} */ public OptionSet parse( String... arguments ) { ArgumentList argumentList = new ArgumentList( arguments ); OptionSet detected = new OptionSet( recognizedOptions.toJavaUtilMap() ); detected.add( recognizedOptions.get( NonOptionArgumentSpec.NAME ) ); while ( argumentList.hasMore() ) state.handleArgument( this, argumentList, detected ); reset(); ensureRequiredOptions( detected ); ensureAllowedOptions( detected ); return detected; }