Class: Oncall::CLI
- Inherits:
-
Object
- Object
- Oncall::CLI
- Defined in:
- lib/oncall/cli.rb
Overview
Manage the processing of command line options
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args, options = Oncall.options) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(args, options = Oncall.options) ⇒ CLI
Returns a new instance of CLI.
6 7 8 9 |
# File 'lib/oncall/cli.rb', line 6 def initialize(args, = Oncall.) @args = args = end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
4 5 6 |
# File 'lib/oncall/cli.rb', line 4 def args @args end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/oncall/cli.rb', line 4 def end |
Class Method Details
.run(args) ⇒ Object
11 12 13 |
# File 'lib/oncall/cli.rb', line 11 def self.run(args) new(args).run end |
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/oncall/cli.rb', line 15 def run load_config_file begin status = .runner.run($stderr, $stdout) rescue Exception => e abort "#{Oncall::SCRIPT}: #{e.message}" end exit(status) if status.is_a? Integer end |