@ SuppressWarnings ( "static-method" ) @ Provides @ Singleton public HelpGenerator provideHelpGenerator ( ApplicationMetadata metadata , Injector injector , Terminal terminal ) { int maxColumns = terminal . getColumns ( ) ; if ( maxColumns < TTY_MIN_COLUMNS ) { maxColumns = TTY_DEFAULT_COLUMNS ; } String argumentSynopsis ; try { argumentSynopsis = injector . getInstance ( Key . get ( String . class , ApplicationArgumentSynopsis . class ) ) ; } catch ( Exception exception ) { argumentSynopsis = null ; } String detailedDescription ; try { detailedDescription = injector . getInstance ( Key . get ( String . class , ApplicationDetailedDescription . class ) ) ; } catch ( Exception exception ) { detailedDescription = null ; } return new SynopsisHelpGenerator ( metadata , argumentSynopsis , detailedDescription , maxColumns ) ; }
Provide the help generator with synopsis .