@ Deprecated public List < List < String > > getParsedArgs ( String [ ] args ) throws InvalidFormatException { for ( int i = 0 ; i < args . length ; i ++ ) { if ( ! args [ i ] . startsWith ( "-" ) ) { if ( this . params . size ( ) > 0 ) { List < String > option = new ArrayList < String > ( ) ; option . add ( this . params . get ( 0 ) . longOption ) ; this . params . remove ( 0 ) ; option . add ( args [ i ] ) ; sortedArgs . add ( option ) ; } else { throw new InvalidFormatException ( "Expected command line option, found " + args [ i ] + " instead." ) ; } } else { for ( Argument option : this . args ) { if ( option . matchesFlag ( args [ i ] ) ) { List < String > command = new ArrayList < String > ( ) ; command . add ( noDashes ( args [ i ] ) ) ; if ( option . takesValue ) { try { if ( args [ i + 1 ] . startsWith ( "-" ) ) { if ( option . valueRequired ) throw new InvalidFormatException ( "Invalid command line format: -" + option . option + " or --" + option . longOption + " requires a parameter, found " + args [ i + 1 ] + " instead." ) ; } else { command . add ( args [ ++ i ] ) ; } } catch ( ArrayIndexOutOfBoundsException e ) { } } sortedArgs . add ( command ) ; break ; } } } } return sortedArgs ; }
Get the parsed and checked command line arguments for this parser