From ed6823e659b54b8089a8b3aaf381025e0ed44761 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sat, 20 May 2017 03:07:37 +0200 Subject: [PATCH] Refactor `CLI::InternalHelp`. --- Library/Homebrew/cask/lib/hbc/cli/internal_help.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cask/lib/hbc/cli/internal_help.rb b/Library/Homebrew/cask/lib/hbc/cli/internal_help.rb index 0908ee05ef..3903f3b080 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/internal_help.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/internal_help.rb @@ -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