From 94191f7b0984410dcb134faa96cd1a0741d5e8f0 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Fri, 27 Dec 2024 11:17:55 -0800 Subject: [PATCH] doc: expand description of `parseArg`'s `default` PR-URL: https://github.com/nodejs/node/pull/54431 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Jordan Harband --- doc/api/util.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/api/util.md b/doc/api/util.md index 22c2454f46a..efabb342381 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -1539,9 +1539,10 @@ changes: times. If `true`, all values will be collected in an array. If `false`, values for the option are last-wins. **Default:** `false`. * `short` {string} A single character alias for the option. - * `default` {string | boolean | string\[] | boolean\[]} The default option - value when it is not set by args. It must be of the same type as the - `type` property. When `multiple` is `true`, it must be an array. + * `default` {string | boolean | string\[] | boolean\[]} The default value to + be used if (and only if) the option does not appear in the arguments to be + parsed. It must be of the same type as the `type` property. When `multiple` + is `true`, it must be an array. * `strict` {boolean} Should an error be thrown when unknown arguments are encountered, or when arguments are passed that do not match the `type` configured in `options`.