Class: Hako::CLI::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/hako/cli.rb

Instance Method Summary collapse

Instance Method Details

#parse!(argv) ⇒ Object



242
243
244
245
246
247
248
249
250
# File 'lib/hako/cli.rb', line 242

def parse!(argv)
  parser.parse!(argv)
  @definition_path = argv.first

  if @definition_path.nil?
    puts parser.help
    exit 1
  end
end

#parserObject



252
253
254
255
256
257
# File 'lib/hako/cli.rb', line 252

def parser
  @parser ||= OptionParser.new do |opts|
    opts.banner = 'hako status FILE'
    opts.version = VERSION
  end
end

#run(argv) ⇒ Object



235
236
237
238
239
240
# File 'lib/hako/cli.rb', line 235

def run(argv)
  parse!(argv)
  require 'hako/application'
  require 'hako/commander'
  Commander.new(Application.new(@definition_path, expand_variables: false)).status
end