Class: Mysh::HelpSubCommand

Inherits:
Action show all
Defined in:
lib/mysh/internal/support/sub_help.rb

Overview

The mysh internal help sub commands.

Instance Attribute Summary

Attributes inherited from Action

#description, #name

Instance Method Summary collapse

Methods inherited from Action

#action_info, #process_quick_command, #short_name

Constructor Details

#initialize(name, description, file_name) ⇒ HelpSubCommand

Setup a help command.



10
11
12
13
# File 'lib/mysh/internal/support/sub_help.rb', line 10

def initialize(name, description, file_name)
  super(name, description)
  @file_name = file_name
end

Instance Method Details

#process_command(_args) ⇒ Object

Execute a help command.



16
17
18
19
# File 'lib/mysh/internal/support/sub_help.rb', line 16

def process_command(_args)
  path = MYSH_LIB + "mysh/help/" + @file_name
  mysh "load #{path.to_host_spec}"
end