Class: TerraformLandscape::CLI

Inherits:
Object
  • Object
show all
Includes:
Commander::Methods
Defined in:
lib/terraform_landscape/cli.rb

Overview

Command line application interface.

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ CLI

Returns a new instance of CLI.



8
9
10
# File 'lib/terraform_landscape/cli.rb', line 8

def initialize(output)
  @output = output
end

Instance Method Details

#run(_args) ⇒ Integer

Parses the given command line arguments and executes appropriate logic based on those arguments.

Parameters:

  • args (Array<String>)

    command line arguments

Returns:

  • (Integer)

    exit status code



18
19
20
21
22
23
24
25
26
27
# File 'lib/terraform_landscape/cli.rb', line 18

def run(_args)
  program :name, 'Terraform Landscape'
  program :version, VERSION
  program :description, 'Pretty-print your Terraform plan output'

  define_commands

  run!
  0 # OK
end