Sha256: dc9632672cdfbf8eb9c6d9f245458722676f5aee65980b0a21768dd6fe51f435

Contents?: true

Size: 1.15 KB

Versions: 6

Compression:

Stored size: 1.15 KB

Contents

require 'trollop'

require 'simple_deploy/stack/stack_lister'

module SimpleDeploy
  module CLI

    class List
      include Shared

      def stacks
        @opts = Trollop::options do
          version SimpleDeploy::VERSION
          banner <<-EOS

List stacks in an environment

simple_deploy list -e ENVIRONMENT

EOS
          opt :environment, "Set the target environment", :type => :string
          opt :log_level, "Log level:  debug, info, warn, error", :type    => :string,
                                                                  :default => 'info'
          opt :read_from_env, "Read credentials and region from environment variables"
          opt :help, "Display Help"
        end

        valid_options? :provided => @opts,
                       :required => [:environment, :read_from_env]

        config_arg = @opts[:read_from_env] ? :read_from_env : @opts[:environment]
        SimpleDeploy.create_config config_arg

        SimpleDeploy.logger @opts[:log_level]

        stacks = SimpleDeploy::StackLister.new.all.sort
        puts stacks
      end

      def command_summary
        'List stacks in an environment'
      end

    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
simple_deploy-0.10.2 lib/simple_deploy/cli/list.rb
simple_deploy-0.10.1 lib/simple_deploy/cli/list.rb
simple_deploy-0.10.0 lib/simple_deploy/cli/list.rb
simple_deploy-0.10.0.beta.3 lib/simple_deploy/cli/list.rb
simple_deploy-0.10.0.beta.2 lib/simple_deploy/cli/list.rb
simple_deploy-0.10.0.beta.1 lib/simple_deploy/cli/list.rb