How to use the dashdash.BASH_COMPLETION_TEMPLATE_PATH function in dashdash

To help you get started, we’ve selected a few dashdash 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 joyent / smartos-live / src / fw / node_modules / cmdln / index.js View on Github external
assert.object(opts, 'opts');
    assert.optionalString(opts.specExtra, 'opts.specExtra');

    // Gather template data.
    var data = {
        name: this.name,
        date: new Date(),
        spec: this.bashCompletionSpec()
    };
    if (opts.specExtra) {
        data.spec += '\n\n' + opts.specExtra;
    }

    // Render template.
    var template = fs.readFileSync(
        dashdash.BASH_COMPLETION_TEMPLATE_PATH, 'utf8');
    return renderTemplate(template, data);
};

dashdash

A light, featureful and explicit option parsing library.

MIT
Latest version published 4 years ago

Package Health Score

67 / 100
Full package analysis