How to use the @boost/args.parseInContext function in @boost/args

To help you get started, we’ve selected a few @boost/args examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github milesj / boost / packages / cli / src / CLI.ts View on Github external
async run(argv: Argv): Promise {
    const { command: cmd, errors, options, params, rest } = parseInContext(
      argv,
      arg => this.getCommand(arg)?.getParserOptions(),
    );

    // Display version and exit
    if (options.version) {
      console.log(this.options.version);

      return;
    }

    // Display errors and exit
    if (errors.length > 0) {
      throw new Error('TODO');
    }

@boost/args

A convention based argument parsing and formatting library, with strict validation checks.

MIT
Latest version published 8 months ago

Package Health Score

61 / 100
Full package analysis

Popular @boost/args functions