Options
All
  • Public
  • Public/Protected
  • All
Menu

Build up data about commands, and then put them in yargs later. The YargBuilder lets you add lots of commands, including ones with spaces in them. Then optimize it, to combine all the commands optimally. You'll get errors if you've added duplicate commands (they won't overwrite each other).

To use it: Get a new one: const yargBuilder = freshYargBuilder();

Add commands to it: yargBuilder.withSubcommand(yargCommandFromSentence({ command: "do this thing already", handler: (argv)=> console.log("stuff")}))

You can also add positional commands: yargBuilder.withSubcommand(yargCommandWithPositionalArguments({ command: "run ", ...}))

Then optimize it, and save by passing a real yargs: yargBuilder.build().save(yargs)

Hierarchy

Implemented by

Index

Methods

build

command

demandCommand

option

  • option(parameterName: string, params: ParameterOptions): YargBuilder

withParameter

withSubcommand

Generated using TypeDoc