Sha256: 327d5f53a907723426532c36836468dda5bedf28a498b2ffa34f3a80f6f610d5
Contents?: true
Size: 1010 Bytes
Versions: 18
Compression:
Stored size: 1010 Bytes
Contents
module Brightbox command [:sql] do |product| product.command [:snapshots] do |cmd| cmd.desc I18n.t("sql.snapshots.update.desc") cmd.arg_name "snapshot-id" cmd.command [:update] do |c| c.desc I18n.t("options.name.desc") c.flag %i[n name] c.desc I18n.t("options.description.desc") c.flag [:d, "description"] c.action do |global_options, options, args| snapshot_id = args.shift unless snapshot_id =~ /^dbi-/ raise "You must specify a valid snapshot id as the first argument" end snapshot = DatabaseSnapshot.find snapshot_id params = NilableHash.new params[:name] = options[:n] if options[:n] params[:description] = options[:d] if options[:d] params.nilify_blanks info "Updating #{snapshot}" snapshot.update params snapshot.reload render_table([snapshot], global_options) end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems