static OptionParserState moreOptions( final boolean posixlyCorrect ) {
        return new OptionParserState() {
            @Override
            protected void handleArgument( OptionParser parser, ArgumentList arguments, OptionSet detectedOptions ) {
                String candidate = arguments.next();
                try {
                    if ( isOptionTerminator( candidate ) ) {
                        parser.noMoreOptions();
                        return;
                    } else if ( isLongOptionToken( candidate ) ) {
                        parser.handleLongOptionToken( candidate, arguments, detectedOptions );
                        return;
                    } else if ( isShortOptionToken( candidate ) ) {
                        parser.handleShortOptionToken( candidate, arguments, detectedOptions );
                        return;
                    }
                } catch ( UnrecognizedOptionException e ) {
                    if ( !parser.doesAllowsUnrecognizedOptions() )
                        throw e;
                }

                if ( posixlyCorrect )
                    parser.noMoreOptions();

                parser.handleNonOptionArgument( candidate, arguments, detectedOptions );
            }
        };
    }