class Bicho::CLI::Commands::Reopen

Command to reopen a bug.

Public Instance Methods

do(global_opts, opts, args) click to toggle source
# File lib/bicho/cli/commands/reopen.rb, line 41
def do(global_opts, opts, args)
  unless opts[:comment]
    t.say('Reopen must have a comment')
    return 1
  end
  client = ::Bicho::Client.new(global_opts[:bugzilla])
  client.get_bugs(*args).each do |bug|
    id = bug.reopen!(opts[:comment], opts[:private])
    if id == bug.id
      t.say("Bug #{id} reopened")
    else
      t.say("#{t.color('ERROR:', :error)} Failed to reopen bug #{id}")
    end
  end
  0
end