brew/Library/Homebrew/cask/lib/hbc/cli/internal_help.rb

28 lines
666 B
Ruby
Raw Normal View History

2016-09-24 13:52:43 +02:00
module Hbc
class CLI
class InternalHelp < InternalUseBase
2017-05-20 03:07:37 +02:00
def self.run(*args)
new(*args).run
end
def run
2016-09-24 13:52:43 +02:00
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
2017-05-20 03:07:37 +02:00
puts " #{klass.command_name.ljust(max_command_len)} #{self.class.help_for(klass)}"
2016-09-24 13:52:43 +02:00
end
puts "\n"
end
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
def self.help_for(klass)
klass.respond_to?(:help) ? klass.help : nil
end
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
def self.help
"print help strings for unstable internal-use commands"
2016-09-24 13:52:43 +02:00
end
end
2016-08-18 22:11:42 +03:00
end
end