class GLI::Commands::HelpModules::CommandHelpFormat

Constants

COMMAND_HELP

Public Instance Methods

format() click to toggle source
# File lib/gli/commands/help_modules/command_help_format.rb, line 15
def format
  command_wrapper      = @wrapper_class.new(Terminal.instance.size[0],4 + @command.name.to_s.size + 3)
  wrapper              = @wrapper_class.new(Terminal.instance.size[0],4)
  
  options_description  = OptionsFormatter.new(flags_and_switches(@command,@app),@sorter,@wrapper_class).format
  commands_description = format_subcommands(@command)
  command_examples = format_examples(@command)

  synopses = @synopsis_formatter.synopses_for_command(@command)
  COMMAND_HELP.result(binding)
end

Public Class Methods

new(command,app,sorter,synopsis_formatter_class,wrapper_class=TextWrapper) click to toggle source
# File lib/gli/commands/help_modules/command_help_format.rb, line 7
def initialize(command,app,sorter,synopsis_formatter_class,wrapper_class=TextWrapper)
  @app = app
  @command = command
  @sorter = sorter
  @wrapper_class = wrapper_class
  @synopsis_formatter = synopsis_formatter_class.new(@app,flags_and_switches(@command,@app))
end