We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
var minimist = require('minimist') var merge = require('mixin-deep') module.exports = function minibaseArgv (opts) { return function (app) { app.define('parseArgv', function (opts) { var argv = minimist(process.argv.slice(2), merge({ alias: { h: 'help', v: 'version' } }, opts)) var keys = Object.keys(argv) app.argv = argv if (!argv._.length && keys.length === 1) { argv.__ = argv.__ || {} argv.__.isCommand = true argv.__.isFlag = true app.emit('help', null, argv) return app } app.emit('_', argv._) app.emit('*', '_', argv._) argv._.forEach(function (key, idx) { argv.__ = argv.__ || {} argv.__.isCommand = true app.emit(key, idx, argv) app.emit(idx, key, argv) }) keys.forEach(function (key) { if (key === '_') return var val = argv[key] argv.__ = argv.__ || {} argv.__.isFlag = true app.emit(key, val, argv) app.emit('*', key, val) }) return app }) } }
attr to minimist-events
minimist-events
The text was updated successfully, but these errors were encountered:
No branches or pull requests
attr to
minimist-events
The text was updated successfully, but these errors were encountered: