13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/coglius/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
|