const download = require('./download');

/**
 * @param {{}} flags
 * @param {string[]} attributes
 * @returns {*}
 */
function run(flags, attributes) {
  if (attributes.length === 0) {
    throw new Error('Command not given.');
  }

  switch (attributes[0]) {
    case 'download':
      return download(flags);

    case 'upload':
      throw new Error('Command not yet implemented.');

    default:
      throw new Error('Command not found.');
  }
}

module.exports = run;
module.exports.readme = require('./readme.md');
