Skip to content

Commit 756c7dd

Browse files
Slayer95aduh95
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 <[email protected]>
1 parent 0b84052 commit 756c7dd

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
@@ -1941,10 +1941,12 @@ changes:
19411941
times. If `true`, all values will be collected in an array. If
19421942
`false`, values for the option are last-wins. **Default:** `false`.
19431943
* `short` {string} A single character alias for the option.
1944-
* `default` {string | boolean | string\[] | boolean\[]} The default value to
1945-
be used if (and only if) the option does not appear in the arguments to be
1946-
parsed. It must be of the same type as the `type` property. When `multiple`
1947-
is `true`, it must be an array.
1944+
* `default` {string | boolean | string\[] | boolean\[]} The value to assign to
1945+
the option if it does not appear in the arguments to be parsed. The value
1946+
must match the type specified by the `type` property. If `multiple` is
1947+
`true`, it must be an array. No default value is applied when the option
1948+
does appear in the arguments to be parsed, even if the provided value
1949+
is falsy.
19481950
* `strict` {boolean} Should an error be thrown when unknown arguments
19491951
are encountered, or when arguments are passed that do not match the
19501952
`type` configured in `options`.

0 commit comments

Comments
 (0)