public String getArgumentUsage ( final Map < String , NamedArgumentDefinition > allActualArguments , final Collection < CommandLinePluginDescriptor < ? > > pluginDescriptors , final int argumentColumnWidth , final int descriptionColumnWidth ) { final StringBuilder sb = new StringBuilder ( ) ; sb . append ( "--" ) . append ( getLongName ( ) ) ; if ( ! getShortName ( ) . isEmpty ( ) ) { sb . append ( ",-" ) . append ( getShortName ( ) ) ; } sb . append ( ":" ) . append ( getUnderlyingFieldClass ( ) . getSimpleName ( ) ) ; int labelLength = sb . toString ( ) . length ( ) ; int numSpaces = argumentColumnWidth - labelLength ; if ( labelLength > argumentColumnWidth ) { sb . append ( "\n" ) ; numSpaces = argumentColumnWidth ; } printSpaces ( sb , numSpaces ) ; final String description = getArgumentDescription ( allActualArguments , pluginDescriptors ) ; final String wrappedDescription = Utils . wrapParagraph ( description , descriptionColumnWidth ) ; final String [ ] descriptionLines = wrappedDescription . split ( "\n" ) ; for ( int i = 0 ; i < descriptionLines . length ; ++ i ) { if ( i > 0 ) { printSpaces ( sb , argumentColumnWidth ) ; } sb . append ( descriptionLines [ i ] ) ; sb . append ( "\n" ) ; } sb . append ( "\n" ) ; return sb . toString ( ) ; }
Return a string with the usage statement for this argument .