public String getOptionsHelpMessage ( ) { String ls = System . getProperty ( "line.separator" ) ; usageMessage = "Available options:" ; StringBuilder sb = new StringBuilder ( usageMessage ) ; sb . append ( ls ) ; for ( Option option : declaredOptions . values ( ) ) { String name = option . getName ( ) ; int extraPadding = longestOptionNameLength - name . length ( ) ; sb . append ( " -" ) . append ( name ) ; for ( int i = 0 ; i < extraPadding ; i ++ ) { sb . append ( ' ' ) ; } sb . append ( DEFAULT_PADDING ) . append ( option . getDescription ( ) ) . append ( ls ) ; } return sb . toString ( ) ; }
Build the options message .