lib/kumogata/client.rb in kumogata-0.4.6 vs lib/kumogata/client.rb in kumogata-0.4.7
- old
+ new
@@ -70,10 +70,19 @@
def export(stack_name)
validate_stack_name(stack_name)
template = export_template(stack_name)
- devaluate_template(template).chomp.colorize_as(:ruby)
+ format = @options.format || :ruby
+
+ case format
+ when :ruby
+ devaluate_template(template).chomp.colorize_as(:ruby)
+ when :json
+ JSON.pretty_generate(template).colorize_as(:json)
+ else
+ raise "Unknown format: #{format}"
+ end
end
def show_events(stack_name)
validate_stack_name(stack_name)