public static CommandLine parseCommandLine ( String [ ] [ ] optionsArrayArray ) { try { List < String > argumentList = new ArrayList < String > ( ) ; for ( String [ ] optionsArray : optionsArrayArray ) { argumentList . addAll ( Arrays . asList ( optionsArray ) ) ; } CommandLineParser commandLineParser = new BasicParser ( ) { @ Override protected void processOption ( final String arg , @ SuppressWarnings ( "rawtypes" ) final ListIterator iter ) throws ParseException { boolean hasOption = getOptions ( ) . hasOption ( arg ) ; if ( hasOption ) { super . processOption ( arg , iter ) ; } } } ; CommandLine commandLine = commandLineParser . parse ( options , argumentList . toArray ( new String [ ] { } ) ) ; return commandLine ; } catch ( ParseException e ) { LoggingOutputStream loggingOutputStream = new LoggingOutputStream ( log , LoggingLevelEnum . INFO ) ; PrintWriter printWriter = new PrintWriter ( loggingOutputStream ) ; HelpFormatter helpFormatter = new HelpFormatter ( ) ; helpFormatter . printHelp ( printWriter , 74 , "javadoc -doclet " + XmlDoclet . class . getName ( ) + " [options]" , null , options , 1 , 3 , null , false ) ; return null ; } }
Parse the given options .