private void parse ( String [ ] args ) { for ( int i = 0 ; i < args . length ; i ++ ) { if ( opt_with_value . containsKey ( args [ i ] ) ) { String key = opt_with_value . get ( args [ i ] ) ; values . put ( key , args [ i + 1 ] ) ; i ++ ; } else if ( args [ i ] . startsWith ( "-" ) ) { opt_without_value . add ( args [ i ] ) ; } else { arglist . add ( args [ i ] ) ; } } }
Command line easy parser