Class: Brut::CLI::Commands::Help
Instance Attribute Summary collapse
Attributes inherited from BaseCommand
#parent_command
Instance Method Summary
collapse
Methods inherited from BaseCommand
#accepts, #args_description, #argv, #default_command, #default_command_class, #env, #env_vars, #execute, #name, #options, #opts, #puts, #stderr, #stdin, #stdout, #system!
Constructor Details
#initialize(command, option_parser) ⇒ Help
Returns a new instance of Help.
5
6
7
8
|
# File 'lib/brut/cli/commands/help.rb', line 5
def initialize(command,option_parser)
@command = command
@option_parser = option_parser
end
|
Instance Attribute Details
#option_parser ⇒ Object
Returns the value of attribute option_parser.
3
4
5
|
# File 'lib/brut/cli/commands/help.rb', line 3
def option_parser
@option_parser
end
|
Instance Method Details
#bootstrap? ⇒ Boolean
24
|
# File 'lib/brut/cli/commands/help.rb', line 24
def bootstrap? = false
|
#commands ⇒ Object
10
|
# File 'lib/brut/cli/commands/help.rb', line 10
def commands = []
|
#default_rack_env ⇒ Object
25
|
# File 'lib/brut/cli/commands/help.rb', line 25
def default_rack_env = nil
|
#description ⇒ Object
2
|
# File 'lib/brut/cli/commands/help.rb', line 2
def description = "Get help for the app or a command"
|
#run ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/brut/cli/commands/help.rb', line 12
def run
stdout.puts_no_prefix @option_parser.to_s
if @command.commands.any?
stdout.puts_no_prefix
stdout.puts_no_prefix "COMMANDS"
stdout.puts_no_prefix
@command.commands.each do |command|
stdout.puts_no_prefix " #{command.name} - #{command.description}"
end
end
0
end
|