Class: Karafka::Cli::Help
Overview
Prints info with list of commands available
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- 
  
    
      #call  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Print available commands.
 
Methods inherited from Base
aliases, commands, desc, #initialize, load, name, names, option, parse_options
Methods included from Helpers::Colorize
Constructor Details
This class inherits a constructor from Karafka::Cli::Base
Instance Method Details
#call ⇒ Object
Print available commands
      11 12 13 14 15 16 17 18 19 20 21  | 
    
      # File 'lib/karafka/cli/help.rb', line 11 def call # Find the longest command for alignment purposes max_command_length = self.class.commands.map(&:name).map(&:size).max puts 'Karafka commands:' # Print each command formatted with its description self.class.commands.each do |command| puts " #{command.name.ljust(max_command_length)} # #{command.desc}" end end  |