# File lib/gli/commands/help_modules/global_help_format.rb, line 13 def format program_desc = @app.program_desc program_long_desc = @app.program_long_desc if program_long_desc wrapper = @wrapper_class.new(Terminal.instance.size[0],4) program_long_desc = "\n #{wrapper.wrap(program_long_desc)}\n\n" if program_long_desc else program_long_desc = "\n" end command_formatter = ListFormatter.new(@sorter.call(@app.commands_declaration_order.reject(&:nodoc)).map { |command| [[command.name,Array(command.aliases)].flatten.join(', '),command.description] }, @wrapper_class) stringio = StringIO.new command_formatter.output(stringio) commands = stringio.string global_option_descriptions = OptionsFormatter.new(global_flags_and_switches,@sorter,@wrapper_class).format GLOBAL_HELP.result(binding) end
# File lib/gli/commands/help_modules/global_help_format.rb, line 7 def initialize(app,sorter,wrapper_class) @app = app @sorter = sorter @wrapper_class = wrapper_class end