#!/usr/bin/env node
const yargs = require('yargs/yargs')
const { hideBin } = require('yargs/helpers')
const commands = require('./src/commands')

require('dotenv').config()

async function run () {
  return yargs(hideBin(process.argv))
    .command(commands)
    .usage('Usage: corellium [OPTIONS]')
    .demandCommand(1, '') // empty string overrides yargs nag message about specifying a command
    .strict() // strict handling of commands and arguments
    .epilogue("Run 'corellium --help' for more information on a command.")
    .wrap(null) // maximize the width of yargs help information
    .parse()
}

run().catch((err) => {
  console.error(err)
})
