const listOSS = require('./list')

async function publish(type) {
  const paramsHandler = {
    ls: listOSS, // 展示oss列表(简写)
    list: listOSS, // 展示oss列表
  }
  if (Object.prototype.hasOwnProperty.call(paramsHandler, type)) {
    await paramsHandler[type]()
  }
}

// 发布命令的核心逻辑
async function execOss(options) {
  Object.keys(options).forEach(async (type) => {
    await publish(type)
  })
}

module.exports = execOss
