'use strict';

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

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

  options: {},

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