I've been making a CLI and i needed yargs for parsing my arguments in a nice way. I am using typescript and i don't know the output of this Function, didn't find it anywhere as well:
const argv = Yargs(hideBin(process.argv))
.command('serve', 'Start the Bots.', (yargs: Argv) => {
return yargs.option('bots', {
alias: 'b',
describe: 'Number of bots to create',
type: 'number',
default: 10,
demand: 'Amount is required!',
});
})
.parse();
Setting the argv
to any
is not a option. I guess extending from the base interface like this:
interface yargs_config extends Yargs.Argv<{}> {
bots: number;
}