Class: Dynamic53::CLI
- Inherits:
-
Object
- Object
- Dynamic53::CLI
- Defined in:
- lib/dynamic_53/cli.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(argv) ⇒ CLI
constructor
A new instance of CLI.
- #parse_options! ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(argv) ⇒ CLI
Returns a new instance of CLI.
6 7 8 9 |
# File 'lib/dynamic_53/cli.rb', line 6 def initialize(argv) @argv = argv @options = {} end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/dynamic_53/cli.rb', line 4 def @options end |
Instance Method Details
#parse_options! ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/dynamic_53/cli.rb', line 11 def parser = parser.parse!(@argv) unless [:hostname] && [:zone] $stderr.puts "Error: both zone and hostname arguments must be provided." $stderr.puts parser. exit(1) end end |