Refactor CLI::InternalHelp.

This commit is contained in:
Markus Reiter 2017-05-20 03:07:37 +02:00
parent cac0c29f73
commit ed6823e659

View File

@ -1,12 +1,16 @@
module Hbc
class CLI
class InternalHelp < InternalUseBase
def self.run(*_ignored)
def self.run(*args)
new(*args).run
end
def run
max_command_len = CLI.commands.map(&:length).max
puts "Unstable Internal-use Commands:\n\n"
CLI.command_classes.each do |klass|
next if klass.visible
puts " #{klass.command_name.ljust(max_command_len)} #{help_for(klass)}"
puts " #{klass.command_name.ljust(max_command_len)} #{self.class.help_for(klass)}"
end
puts "\n"
end