Module: Moonshot::Commands::TagArguments

Included in:
Create, Update
Defined in:
lib/moonshot/commands/tag_arguments.rb

Instance Method Summary collapse

Instance Method Details

#parserObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/moonshot/commands/tag_arguments.rb', line 6

def parser
  parser = super

  parser.on('--tag KEY=VALUE', '-TKEY=VALUE', 'Specify Stack Tag on the command line') do |v|
    data = v.split('=', 2)
    unless data.size == 2
      raise "Invalid tag format '#{v}', expected KEY=VALUE (e.g. MyStackTag=12)"
    end

    Moonshot.config.extra_tags << { key: data[0], value: data[1] }
  end
end