Class: Route53::CLI
- Inherits:
-
Object
- Object
- Route53::CLI
- Defined in:
- lib/route53/cli.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(arguments, stdin) ⇒ CLI
constructor
A new instance of CLI.
-
#run ⇒ Object
Parse options, check arguments, then process the command.
Constructor Details
#initialize(arguments, stdin) ⇒ CLI
Returns a new instance of CLI.
13 14 15 16 17 18 19 20 21 |
# File 'lib/route53/cli.rb', line 13 def initialize(arguments, stdin) @arguments = arguments @stdin = stdin # Set defaults @options = OpenStruct.new @options.verbose = false @options.quiet = false end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/route53/cli.rb', line 11 def @options end |
Instance Method Details
#run ⇒ Object
Parse options, check arguments, then process the command
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/route53/cli.rb', line 26 def run if && arguments_valid? puts "Start at #{DateTime.now}\n\n" if @options.verbose if @options.verbose # [Optional] process_arguments process_command puts "\nFinished at #{DateTime.now}" if @options.verbose else puts "ERROR: Invalid Options passed. Please run with --help" exit 1 end end |