How to use the @hapi/bossy.usage function in @hapi/bossy

To help you get started, we’ve selected a few @hapi/bossy 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 hapipal / hpal-debug / lib / commands / curl.js View on Github external
'hpal run debug:curl  [options]',
            'hpal run debug:curl [] 
github hapijs / lab / lib / cli.js View on Github external
'lint-warnings-threshold': 0,
        paths: ['test'],
        reporter: 'console',
        shuffle: false,
        silence: false,
        'silent-skips': false,
        sourcemaps: false,
        'context-timeout': 0,
        timeout: 2000,
        verbose: false
    };

    const argv = Bossy.parse(definition);

    if (argv instanceof Error) {
        console.error(Bossy.usage(definition, 'lab [options] [path]'));
        console.error('\n' + argv.message);
        process.exit(1);
    }

    if (argv.help) {
        console.log(Bossy.usage(definition, 'lab [options] [path]'));
        process.exit(0);
    }

    if (argv.version) {
        console.log(Pkg.version);
        process.exit(0);
    }

    const options = Object.assign({}, defaults, internals.rc);
    options.paths = argv._ ? [].concat(argv._) : options.paths;
github hapijs / lab / lib / cli.js View on Github external
sourcemaps: false,
        'context-timeout': 0,
        timeout: 2000,
        verbose: false
    };

    const argv = Bossy.parse(definition);

    if (argv instanceof Error) {
        console.error(Bossy.usage(definition, 'lab [options] [path]'));
        console.error('\n' + argv.message);
        process.exit(1);
    }

    if (argv.help) {
        console.log(Bossy.usage(definition, 'lab [options] [path]'));
        process.exit(0);
    }

    if (argv.version) {
        console.log(Pkg.version);
        process.exit(0);
    }

    const options = Object.assign({}, defaults, internals.rc);
    options.paths = argv._ ? [].concat(argv._) : options.paths;

    const keys = ['assert', 'bail', 'colors', 'context-timeout', 'coverage', 'coverage-exclude',
        'coverage-path', 'coverage-all', 'coverage-flat', 'coverage-module', 'coverage-pattern', 'default-plan-threshold', 'dry', 'environment', 'flat', 'globals', 'grep',
        'lint', 'lint-errors-threshold', 'lint-fix', 'lint-options', 'lint-warnings-threshold',
        'linter', 'output', 'pattern', 'reporter', 'seed', 'shuffle', 'silence',
        'silent-skips', 'sourcemaps', 'threshold', 'timeout', 'transform', 'types', 'types-test', 'verbose'];
github cjihrig / belly-button / lib / cli.js View on Github external
module.exports.run = async function (argv, callback) {
  const args = Bossy.parse(cliArgs, { argv });

  if (args instanceof Error) {
    return callback(new Error(Bossy.usage(cliArgs, args.message)));
  }

  const configFile = args.config;
  const globs = args.input;
  const ignore = args.ignore;
  const fix = args.fix;
  const cache = args.cache;
  const cwd = args.pwd || process.cwd();

  try {
    const files = await getFilesToLint({ globs, ignore, cwd });
    const result = lintFiles({ configFile, fix, cache, files });
    const exitCode = +!!result.errorCount;
    const output = formatResults(result);

    callback(null, output, exitCode);
github hapipal / hpal-debug / lib / commands / routes.js View on Github external
const getUsage = () => {

        const usage = [
            'hpal run debug:routes [options]',
            'hpal run debug:routes  [options]',
            'hpal run debug:routes [] 

@hapi/bossy

Command line options parser

BSD-3-Clause
Latest version published 2 years ago

Package Health Score

57 / 100
Full package analysis

Popular @hapi/bossy functions