Class: PuppetHerald::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet-herald/cli.rb

Overview

A CLI class

Instance Method Summary collapse

Constructor Details

#initializeCLI

Initialize CLI



12
13
14
# File 'lib/puppet-herald/cli.rb', line 12

def initialize
  self
end

Instance Method Details

#run!(argv = ARGV) ⇒ Integer

Executes an Herald app from CLI

Parameters:

  • argv (Array) (defaults to: ARGV)

    an argv from CLI

Returns:

  • (Integer)

    a status code for program



20
21
22
23
24
25
26
# File 'lib/puppet-herald/cli.rb', line 20

def run!(argv = ARGV)
  PuppetHerald.rackenv

  options = parse_or_kill argv, 2
  run_or_kill options, 1
  Kernel.exit 0
end