@Override protected void detectOptionArgument( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions ) { if ( !arguments.hasMore() ) throw new OptionMissingRequiredArgumentException( this ); arguments.treatNextAsLongOption(); } }
@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 ); }
/** * 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( defaultValues() ); while ( argumentList.hasMore() ) state.handleArgument( this, argumentList, detected ); reset(); ensureRequiredOptions( detected ); return detected; }
@Override protected void handleArgument( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions ) { detectedOptions.addNonOptionArgument( 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 ); }
/** * 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( defaultValues() ); while ( argumentList.hasMore() ) state.handleArgument( this, argumentList, detected ); reset(); ensureRequiredOptions( detected ); return detected; }
@Override protected void handleArgument( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions ) { parser.handleNonOptionArgument( arguments.next(), arguments, detectedOptions ); } };
@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() ) throw new OptionMissingRequiredArgumentException( this ); arguments.treatNextAsLongOption(); } }
/** * 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( defaultValues() ); while ( argumentList.hasMore() ) state.handleArgument( this, argumentList, detected ); reset(); ensureRequiredOptions( detected ); return detected; }
@Override protected void handleArgument( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions ) { parser.handleNonOptionArgument( arguments.next(), arguments, detectedOptions ); } };
@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() ) // GemFire Addition : Changed to include OptionSet throw new OptionMissingRequiredArgumentException( options(), detectedOptions ); addArguments( detectedOptions, arguments.next() ); } }
@Override protected void detectOptionArgument( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions ) { if ( !arguments.hasMore() ) // GemFire Addition: Changed to include OptionSet throw new OptionMissingRequiredArgumentException( options(), detectedOptions ); arguments.treatNextAsLongOption(); } }
/** * 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; }
@Override protected void handleArgument( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions ) { detectedOptions.addNonOptionArgument( arguments.next() ); } };
@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() ) // GemFire Addition : Changed to include OptionSet throw new OptionMissingRequiredArgumentException( options(), detectedOptions ); addArguments( detectedOptions, arguments.next() ); } }