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



236
237
238
239
240
241
242
243
244
# File 'lib/hako/cli.rb', line 236

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

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

#parserObject



246
247
248
249
250
251
# File 'lib/hako/cli.rb', line 246

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

#run(argv) ⇒ Object



229
230
231
232
233
234
# File 'lib/hako/cli.rb', line 229

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