Sha256: 4e431fdabbeb3971c8d3845f6f891969b09cbaef16c545ed29c02b69290167ea

Contents?: true

Size: 848 Bytes

Versions: 6

Compression:

Stored size: 848 Bytes

Contents

# frozen_string_literal: true

require 'lino'
require_relative 'base'

module RubyTerraform
  module Commands
    class Format < Base
      def configure_command(builder, opts)
        directory = opts[:directory]
        check = opts[:check]
        diff = opts[:diff]
        list = opts[:list]
        no_color = opts[:no_color]
        recursive = opts[:recursive]
        write = opts[:write]

        builder.with_subcommand('fmt') do |sub|
          sub = sub.with_option('-list', list) if list
          sub = sub.with_option('-write', write) if write

          sub = sub.with_flag('-check') if check
          sub = sub.with_flag('-diff') if diff
          sub = sub.with_flag('-no-color') if no_color
          sub = sub.with_flag('-recursive') if recursive
          sub
        end.with_argument(directory)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-terraform-0.64.0 lib/ruby_terraform/commands/format.rb
ruby-terraform-0.63.0.pre.1 lib/ruby_terraform/commands/format.rb
ruby-terraform-0.62.0 lib/ruby_terraform/commands/format.rb
ruby-terraform-0.61.0.pre.1 lib/ruby_terraform/commands/format.rb
ruby-terraform-0.60.0 lib/ruby_terraform/commands/format.rb
ruby-terraform-0.59.0.pre.2 lib/ruby_terraform/commands/format.rb