Class: Awshucks::ListCommand

Inherits:
Command show all
Defined in:
lib/awshucks/commands/list.rb

Instance Method Summary collapse

Methods inherited from Command

commands, execute, inherited, #option_parser, option_string, parse_and_execute

Instance Method Details

#execute(args, config) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/awshucks/commands/list.rb', line 8

def execute(args, config)
  @config = config
  list = []
  if args.empty?
    list += config.backups
  else
    list << config.backup(args.first)
  end
  
  list.each {|b| list(b) }
  
rescue UnknownBackupError
  $stderr.puts "Unknown backup: #{args.first}"
end