You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -227,6 +227,16 @@ It is already possible to build great arg parsing modules on top of what Node.js
227
227
228
228
It is exceedingly difficult to provide an API which would both be friendly to these Node.js users while being extensible enough for libraries to build upon. We chose to prioritize these use cases because these are currently not well-served by Node.js' API.
* `config` {Object} (Optional) The `config` parameter is an
273
-
object supporting the following properties:
274
-
* `args` {string[]} (Optional) Array of argument strings; defaults
275
-
to [`process.mainArgs`](process_argv)
276
-
* `options` {Object} (Optional) An object describing the known options to look for in `args`; `options` keys are the long names of the known options, and the values are objects with the following properties:
277
-
* `type` {'string'|'boolean'} (Required) Type of known option
278
-
* `multiple` {boolean} (Optional) If true, when appearing one or more times in `args`, results are collected in an `Array`
279
-
* `short` {string} (Optional) A single character alias for an option; When appearing one or more times in `args`; Respects the `multiple` configuration
280
-
* `strict` {Boolean} (Optional) A `Boolean` for whether or not to throw an error when unknown options are encountered, `type:'string'` options are missing an options-argument, or `type:'boolean'` options are passed an options-argument; defaults to `true`
281
-
* `allowPositionals` {Boolean} (Optional) Whether this command accepts positional arguments. Defaults `false` if `strict` is `true`, otherwise defaults to `true`.
282
-
* Returns: {Object} An object having properties:
283
-
* `values` {Object}, key:value for each option found. Value is a string for string options, or `true` for boolean options, or an array (of strings or booleans) for options configured as `multiple:true`.
0 commit comments