@ Override public String printHelp ( ) { List < CommandLineParser < CI >> parsers = getChildParsers ( ) ; if ( parsers != null && parsers . size ( ) > 0 ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( processedCommand . printHelp ( helpNames ( ) ) ) . append ( Config . getLineSeparator ( ) ) . append ( processedCommand . name ( ) ) . append ( " commands:" ) . append ( Config . getLineSeparator ( ) ) ; int maxLength = 0 ; for ( CommandLineParser child : parsers ) { int length = child . getProcessedCommand ( ) . name ( ) . length ( ) ; if ( length > maxLength ) { maxLength = length ; } } for ( CommandLineParser child : parsers ) { sb . append ( child . getFormattedCommand ( 4 , maxLength + 2 ) ) . append ( Config . getLineSeparator ( ) ) ; } return sb . toString ( ) ; } else return processedCommand . printHelp ( helpNames ( ) ) ; }
Returns a usage String based on the defined command and options . Useful when printing help info etc .