Class: AsgDetailer::CLI
- Inherits:
-
Object
- Object
- AsgDetailer::CLI
- Defined in:
- lib/asg-detailer/cli.rb
Instance Attribute Summary collapse
-
#conf ⇒ Object
Returns the value of attribute conf.
Instance Method Summary collapse
-
#initialize(args) ⇒ CLI
constructor
A new instance of CLI.
- #run(options) ⇒ Object
Constructor Details
#initialize(args) ⇒ CLI
Returns a new instance of CLI.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/asg-detailer/cli.rb', line 9 def initialize(args) = {} opt_parser = OptionParser.new do |opts| opts. = 'Usage: asg-detailer [ option ... ]' opts.separator '' opts.separator 'Specific options:' opts.on('-a', '--asg STRING', String, 'The ASG name') do |asg| [:asg] = asg end opts.on('-j', '--json', 'Output data as JSON') do |json| [:json] = true end opts.on('-p', '--pretty-json', 'Output data as pretty_generated JSON') do |pretty| [:pretty] = true end end opt_parser.parse!(args) if [:asg].nil? puts opt_parser exit end self.run() end |
Instance Attribute Details
#conf ⇒ Object
Returns the value of attribute conf.
7 8 9 |
# File 'lib/asg-detailer/cli.rb', line 7 def conf @conf end |