public Options addOption ( Option opt ) { String key = opt . getKey ( ) ; // add it to the long option list if ( opt . hasLongName ( ) ) { longOpts . put ( opt . getLongName ( ) , opt ) ; } // if the option is required add it to the required list if ( opt . isRequired ( ) ) { if ( requiredOpts . contains ( key ) ) { requiredOpts . remove ( requiredOpts . indexOf ( key ) ) ; } requiredOpts . add ( key ) ; } shortOpts . put ( key , opt ) ; return this ; }
Adds an option instance .