Sha256: 03a53689f9df9f0061e4f1f633b5530c36e03d202511809d37f1c30914a6639c

Contents?: true

Size: 647 Bytes

Versions: 21

Compression:

Stored size: 647 Bytes

Contents

# frozen_string_literal: true

module Karafka
  module Web
    class Cli
      # Displays help
      class Help < Base
        desc 'Describes available commands'

        # Print available commands
        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
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
karafka-web-0.10.4 lib/karafka/web/cli/help.rb
karafka-web-0.10.3 lib/karafka/web/cli/help.rb
karafka-web-0.10.2 lib/karafka/web/cli/help.rb
karafka-web-0.10.1 lib/karafka/web/cli/help.rb
karafka-web-0.10.0 lib/karafka/web/cli/help.rb
karafka-web-0.10.0.rc2 lib/karafka/web/cli/help.rb
karafka-web-0.10.0.rc1 lib/karafka/web/cli/help.rb
karafka-web-0.10.0.beta1 lib/karafka/web/cli/help.rb
karafka-web-0.9.1 lib/karafka/web/cli/help.rb
karafka-web-0.9.0 lib/karafka/web/cli/help.rb
karafka-web-0.9.0.rc3 lib/karafka/web/cli/help.rb
karafka-web-0.9.0.rc2 lib/karafka/web/cli/help.rb
karafka-web-0.9.0.rc1 lib/karafka/web/cli/help.rb
karafka-web-0.8.2 lib/karafka/web/cli/help.rb
karafka-web-0.8.1 lib/karafka/web/cli/help.rb
karafka-web-0.8.0 lib/karafka/web/cli/help.rb
karafka-web-0.8.0.rc1 lib/karafka/web/cli/help.rb
karafka-web-0.7.10 lib/karafka/web/cli/help.rb
karafka-web-0.7.9 lib/karafka/web/cli/help.rb
karafka-web-0.7.8 lib/karafka/web/cli/help.rb