'use strict';

var Command = require('ronin').Command;
var debug = require('debug');
var log = debug('cli:bootstrap');
log.error = debug('cli:bootstrap:error');
var utils = require('../../utils');

module.exports = Command.extend({
  desc: 'Removes peers from the bootstrap list',

  options: {},

  run: function run(multiaddr) {
    utils.getIPFS(function (err, ipfs) {
      if (err) {
        throw err;
      }
      ipfs.bootstrap.rm(multiaddr, function (err, list) {
        if (err) {
          return log.error(err);
        }
      });
    });
  }
});