public Command findCommand ( String name ) { for ( Command candidate : this . commands ) { String candidateName = candidate . getName ( ) ; if ( candidateName . equals ( name ) || ( isOptionCommand ( candidate ) && ( "--" + candidateName ) . equals ( name ) ) ) { return candidate ; } } return null ; }
Find a command by name .