'use strict';

var _keys = require('babel-runtime/core-js/object/keys');

var _keys2 = _interopRequireDefault(_keys);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Command = require('ronin').Command;
var path = require('path');
var ronin = require('ronin');

module.exports = Command.extend({
  desc: 'List all available commands',

  run: function run(name) {
    var cli = ronin(path.resolve(__dirname, '..'));

    cli.setupCommands();

    var commands = [''].concat((0, _keys2.default)(cli.commands)).map(function (command) {
      return 'ipfs ' + command;
    }).join('\n');

    console.log(commands);
  }
});