Sha256: 41a72d80e7c1dbe28e6d03bf2442a51f04251a33cf849e4ec5299d4643731131

Contents?: true

Size: 1.22 KB

Versions: 7

Compression:

Stored size: 1.22 KB

Contents

require 'trollop'

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 :help, "Display Help"
        end

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

        config = Config.new.environment @opts[:environment]
        stacks = Stackster::StackLister.new(:config => config).all.sort

        stack = Stack.new :environment => @opts[:environment],
                          :name        => @opts[:name],
                          :config      => config,
                          :logger      => logger
        puts stacks
      end

      def logger
        @logger ||= SimpleDeployLogger.new :log_level => @opts[:log_level]
      end

      def command_summary
        'List stacks in an environment'
      end

    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
simple_deploy-0.7.2 lib/simple_deploy/cli/list.rb
simple_deploy-0.7.2.beta.1 lib/simple_deploy/cli/list.rb
simple_deploy-0.7.1 lib/simple_deploy/cli/list.rb
simple_deploy-0.7.0 lib/simple_deploy/cli/list.rb
simple_deploy-0.6.7 lib/simple_deploy/cli/list.rb
simple_deploy-0.6.6 lib/simple_deploy/cli/list.rb
simple_deploy-0.6.5 lib/simple_deploy/cli/list.rb