def format(operation,format = nil)
access_core
ensure_valid_option operation, %w(add rm list), "operation"
if operation == 'list'
puts "Available formats:"
puts VALID_FORMATS
else
existing_types = @core.options.build_types || []
chosen_types = case operation
when "add"
ensure_valid_option format, VALID_FORMATS, "format"
@core.options.build_types = (existing_types + [format]).uniq
when "rm"
@core.options.build_types = (existing_types - [format])
else
existing_types
end
puts "Chosen formats:"
puts chosen_types
end
end