const subcommands = [
  require('./ready'),
  require('./file'),
  require('./apps')
]

/**
 * @typedef {object} YARGS
 * @property {function} YARGS.showHelp
 * @property {function} YARGS.command
 * @property {function} YARGS.scriptName
 */

/**
 * @typedef {function} command
 * @param {any} subcommands
 * @returns {YARGS}
 */

let _yargs /** @type {YARGS} */

module.exports = {
  builder: yargs => (_yargs = yargs) && yargs.command(subcommands).scriptName(''),
  handler: argv => !argv[1] && _yargs.showHelp(),
  command: 'agent',
  describe: 'Agent related commands'
}
