Combine the tree of commands, convert duplicates into warnings. After this, you should only save.
This exists to be compatible with yargs syntax once we aren't using it, we could remove it
This exists to be compatible with yargs syntax But really, we'll figure out whether to call demandCommand() on yargs based on whether a handler function was supplied
This exists to be compatible with yargs syntax once we aren't using it, we could remove it
Add a subcommand. Pass in a yargs-style object, except you can also include conflictResolution and Parameters
A yargs-style object, or a YargCommand from this package.
Generated using TypeDoc
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)