public static void parse ( String [ ] args ) { for ( int i = 0 ; args != null && i < args . length ; i ++ ) { // First parse args that don't require an option if ( "--help" . equals ( args [ i ] ) ) { abort ( null ) ; } // Now parse args that must be accompanied by an option if ( i + 1 < args . length ) { parseArgumentWithOption ( args [ i ] , args [ ++ i ] ) ; // force increment the counter } } // Abort if required args were not given if ( config == null ) { abort ( "Configuration file or string was not given" ) ; } else if ( config . getAgents ( ) == null || config . getAgents ( ) . isEmpty ( ) ) { abort ( "Configuration is missing agents specification" ) ; } }
Parses the given command line arguments .