Class: Karafka::Web::Cli::Help

Inherits:
Base
  • Object
show all
Defined in:
lib/karafka/web/cli/help.rb

Overview

Displays help

Instance Method Summary collapse

Methods inherited from Base

commands

Instance Method Details

#callObject

Print available commands



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/karafka/web/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 Web UI 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