class TerraformLandscape::CLI

Command line application interface.

def define_commands

def define_commands
  command :print do |c|
    c.action do |_args, options|
      print(options.__hash__)
    end
    c.description = <<-TXT
etty-prints your Terraform plan output.
 an error occurs while parsing the Terraform output, print will automatically fall back on the original Terraform output. To view the stack trace instead, provide the global --trace option.
    TXT
  end
  global_option '--no-color', 'Do not output any color' do
    String.disable_colorization = true
    @output.color_enabled = false
  end
  default_command :print
end

def initialize(output)

def initialize(output)
  @output = output
end

def print(options)

def print(options)
  printer = Printer.new(@output)
  printer.process_stream(ARGF, options)
end

def run(_args)

Returns:
  • (Integer) - exit status code

Parameters:
  • args (Array) -- command line arguments
def run(_args)
  program :name, 'Terraform Landscape'
  program :version, VERSION
  program :description, 'Pretty-print your Terraform plan output'
  define_commands
  run!
  0 # OK
end