Class: Mysh::CommandOption

Inherits:
Action show all
Defined in:
lib/mysh/command_line.rb

Overview

A mysh command line option.

Instance Attribute Summary

Attributes inherited from Action

#description, #name

Instance Method Summary collapse

Methods inherited from Action

#action_info, #initialize, #process_quick_command, #short_name

Constructor Details

This class inherits a constructor from Mysh::Action

Instance Method Details

#get_arg(read_point) ⇒ Object

Get an argument for an option.



21
22
23
24
25
26
27
# File 'lib/mysh/command_line.rb', line 21

def get_arg(read_point)
  result = read_point.next
  fail if COMMAND_LINE.exists?(result) #An arg should not be a command!
  result
rescue
  fail "Error in #{short_name.inspect}: Invalid argument: #{result.inspect}"
end

#post_boot(_args) ⇒ Object

Execute a post-boot command line option.



16
# File 'lib/mysh/command_line.rb', line 16

def post_boot(_args); end

#pre_boot(_args) ⇒ Object Also known as: process_command

Execute a pre-boot command line option.



13
# File 'lib/mysh/command_line.rb', line 13

def pre_boot(_args); end