Skip to content

Commit 6cb5e0d

Browse files
Slayer95targos
authored andcommitted
doc: refine util.parseArgs default definition
The default value is legal by means other than defaulting. PR-URL: #58958 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent d2e7f8e commit 6cb5e0d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

doc/api/util.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,10 +1955,12 @@ changes:
19551955
times. If `true`, all values will be collected in an array. If
19561956
`false`, values for the option are last-wins. **Default:** `false`.
19571957
* `short` {string} A single character alias for the option.
1958-
* `default` {string | boolean | string\[] | boolean\[]} The default value to
1959-
be used if (and only if) the option does not appear in the arguments to be
1960-
parsed. It must be of the same type as the `type` property. When `multiple`
1961-
is `true`, it must be an array.
1958+
* `default` {string | boolean | string\[] | boolean\[]} The value to assign to
1959+
the option if it does not appear in the arguments to be parsed. The value
1960+
must match the type specified by the `type` property. If `multiple` is
1961+
`true`, it must be an array. No default value is applied when the option
1962+
does appear in the arguments to be parsed, even if the provided value
1963+
is falsy.
19621964
* `strict` {boolean} Should an error be thrown when unknown arguments
19631965
are encountered, or when arguments are passed that do not match the
19641966
`type` configured in `options`.

0 commit comments

Comments
 (0)