Class: ItsyBtc::Commands::HelpCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/itsy-btc/commands/help_command.rb

Constant Summary collapse

SPACING =
40

Instance Attribute Summary

Attributes inherited from Command

#wallet

Instance Method Summary collapse

Methods inherited from Command

args, name, summary

Instance Method Details

#runObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/itsy-btc/commands/help_command.rb', line 9

def run
  puts "Usage: itsy <command> [args...]"
  puts
  puts "Available commands:"
  ItsyBtc::Commands::LIST.each do |cmd_class|
    spacing = " " * (SPACING - cmd_class.name.length - 1 - cmd_class.args.to_s.length)
    puts "  #{cmd_class.name} #{cmd_class.args}#{spacing}#{cmd_class.summary}"
  end
  puts
end