private int printHelpOptions ( CliOutputSettings settings , Map < CliOption , CliOptionHelpInfo > option2HelpMap , StringBuilder parameters , Collection < CliOptionContainer > modeOptions ) { int maxOptionColumnWidth = 0 ; for ( CliOptionContainer option : modeOptions ) { CliOption cliOption = option . getOption ( ) ; if ( parameters . length ( ) > 0 ) { parameters . append ( " " ) ; } if ( ! cliOption . required ( ) ) { parameters . append ( "[" ) ; } parameters . append ( cliOption . name ( ) ) ; if ( ! option . getSetter ( ) . getPropertyClass ( ) . equals ( boolean . class ) ) { parameters . append ( " " ) ; parameters . append ( cliOption . operand ( ) ) ; if ( option . isArrayMapOrCollection ( ) ) { CliContainerStyle containerStyle = option . getContainerStyle ( this . cliState . getCliStyle ( ) ) ; switch ( containerStyle ) { case COMMA_SEPARATED : parameters . append ( ",..." ) ; break ; case MULTIPLE_OCCURRENCE : parameters . append ( "*" ) ; break ; default : throw new IllegalCaseException ( CliContainerStyle . class , containerStyle ) ; } } } if ( ! cliOption . required ( ) ) { parameters . append ( "]" ) ; } CliOptionHelpInfo helpInfo = option2HelpMap . get ( cliOption ) ; if ( helpInfo == null ) { helpInfo = new CliOptionHelpInfo ( option , this . dependencies , settings ) ; option2HelpMap . put ( cliOption , helpInfo ) ; } if ( helpInfo . length > maxOptionColumnWidth ) { maxOptionColumnWidth = helpInfo . length ; } } return maxOptionColumnWidth ; }
Prints the options for the help usage output .