Sha256: 1b26aac1a50697c97d2af7aad77985624400d1ab8ae68534a817d48a5e0cebac

Contents?: true

Size: 1.36 KB

Versions: 30

Compression:

Stored size: 1.36 KB

Contents

# frozen_string_literal: true

require_relative 'base'
require_relative '../options/global'

module RubyTerraform
  module Commands
    # Wraps the +terraform show+ command which reads and outputs a Terraform
    # state or plan file in a human-readable form. If no path is specified, the
    # current state will be shown.
    #
    # For options accepted on construction, see {#initialize}.
    #
    # When executing an instance of {Show} via {#execute}, the following
    # options are supported:
    #
    # * +:path+: the path to a state file or plan to show.
    # * +:chdir+: the path of a working directory to switch to before executing
    #   the given subcommand.
    # * +:no_color+: whether or not the output from the command should be in
    #   color; defaults to +false+.
    # * +:json+: if +true+, outputs the Terraform plan or state in a
    #   machine-readable form; defaults to +false+.
    #
    # @example Basic Invocation
    #   RubyTerraform::Commands::Show.new.execute
    #
    class Show < Base
      include RubyTerraform::Options::Global

      # @!visibility private
      def subcommands
        %w[show]
      end

      # @!visibility private
      def options
        %w[
          -json
          -no-color
        ] + super
      end

      # @!visibility private
      def arguments(parameters)
        [parameters[:path]]
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
ruby-terraform-1.6.0.pre.4 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.6.0.pre.3 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.6.0.pre.2 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.6.0.pre.1 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.5.0 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.5.0.pre.5 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.5.0.pre.4 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.5.0.pre.3 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.5.0.pre.2 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.5.0.pre.1 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.4.0 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.4.0.pre.5 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.4.0.pre.4 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.4.0.pre.3 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.4.0.pre.2 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.4.0.pre.1 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.3.1 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.3.0 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.3.0.pre.3 lib/ruby_terraform/commands/show.rb
ruby-terraform-1.3.0.pre.2 lib/ruby_terraform/commands/show.rb