Class: SimpleDeploy::CLI::List
- Inherits:
-
Object
- Object
- SimpleDeploy::CLI::List
show all
- Includes:
- Shared
- Defined in:
- lib/simple_deploy/cli/list.rb
Instance Method Summary
collapse
Methods included from Shared
#command_name, #parse_attributes, #rescue_exceptions_and_exit, #valid_options?
Instance Method Details
#command_summary ⇒ Object
40
41
42
|
# File 'lib/simple_deploy/cli/list.rb', line 40
def command_summary
'List stacks in an environment'
end
|
#stacks ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/simple_deploy/cli/list.rb', line 11
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
|