Class: Vnehm::HelpCommand
Constant Summary
collapse
- SPACES_BTWN_NAME_AND_DESC =
3
Instance Attribute Summary
Attributes inherited from Command
#options, #options_descs
Instance Method Summary
collapse
Methods inherited from Command
#add_option, #handle_options, #initialize, #invoke
Constructor Details
This class inherits a constructor from Vnehm::Command
Instance Method Details
#arguments ⇒ Object
21
22
23
|
# File 'lib/vnehm/commands/help_command.rb', line 21
def arguments
{ 'КОМАНДА' => 'имя команды (может быть сокращено), справку которой нужно показать' }
end
|
#execute ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/vnehm/commands/help_command.rb', line 6
def execute
command_name = options[:args].pop
if command_name.nil?
UI.say HELP
UI.term
end
@cmd = CommandManager.find_command(command_name)
show_usage
show_summary
show_arguments unless @cmd.arguments.empty?
show_options unless @cmd.options.empty?
end
|
#program_name ⇒ Object
25
26
27
|
# File 'lib/vnehm/commands/help_command.rb', line 25
def program_name
'vnehm help'
end
|
#summary ⇒ Object
29
30
31
|
# File 'lib/vnehm/commands/help_command.rb', line 29
def summary
'Показ справки для определенной команды'
end
|
#usage ⇒ Object
33
34
35
|
# File 'lib/vnehm/commands/help_command.rb', line 33
def usage
"#{program_name} КОМАНДА"
end
|