Class: Senedsa::CLI
- Inherits:
-
Object
- Object
- Senedsa::CLI
- Defined in:
- lib/senedsa/cli.rb
Constant Summary collapse
- ID =
File.basename($PROGRAM_NAME).to_sym
- DEFAULT_CONFIG_FILE =
File.join(ENV['HOME'],"/.#{ID}/config")
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(arguments) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(arguments) ⇒ CLI
Returns a new instance of CLI.
15 16 17 18 19 |
# File 'lib/senedsa/cli.rb', line 15 def initialize(arguments) @arguments = arguments @cli_options = { :debug => false } @options = {} end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
13 14 15 |
# File 'lib/senedsa/cli.rb', line 13 def @options end |
Instance Method Details
#run ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/senedsa/cli.rb', line 21 def run begin arguments_valid? process_arguments process_command rescue ArgumentError, OptionParser::MissingArgument, SendNsca::ConfigurationError => e e., 1 end end |