Class: Bookbinder::Commands::Help

Inherits:
Object
  • Object
show all
Includes:
Naming
Defined in:
lib/bookbinder/commands/help.rb

Instance Method Summary collapse

Methods included from Naming

#command_for?, #command_type, #flag?

Constructor Details

#initialize(logger, other_commands) ⇒ Help

Returns a new instance of Help.



8
9
10
11
# File 'lib/bookbinder/commands/help.rb', line 8

def initialize(logger, other_commands)
  @logger = logger
  @other_commands = other_commands
end

Instance Method Details

#runObject



17
18
19
20
# File 'lib/bookbinder/commands/help.rb', line 17

def run(*)
  logger.log(usage_message)
  0
end

#usageObject



13
14
15
# File 'lib/bookbinder/commands/help.rb', line 13

def usage
  [command_name, "Print this message"]
end

#usage_messageObject



22
23
24
# File 'lib/bookbinder/commands/help.rb', line 22

def usage_message
  [usage_header, command_usage_messages].join("\n")
end