Skip to content

Commit

Permalink
docs(api): add description for coerce behavior for array type argument (
Browse files Browse the repository at this point in the history
  • Loading branch information
yxliang01 authored and mleguen committed Aug 28, 2019
1 parent b7ec0df commit 434def5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/api.md
Expand Up @@ -137,10 +137,10 @@ var argv = require('yargs')
Provide a synchronous function to coerce or transform the value(s) given on the
command line for `key`.

The coercion function should accept one argument, representing the parsed value
from the command line, and should return a new value or throw an error. The
returned value will be used as the value for `key` (or one of its aliases) in
`argv`.
The coercion function should accept one argument, representing the parsed value from
the command line (an array if multiple values are parsed for the key), and should
return a new value or throw an error. The returned value will be used as the value for
`key` (or one of its aliases) in `argv`.

If the function throws, the error will be treated as a validation
failure, delegating to either a custom [`.fail()`](#fail) handler or printing
Expand Down

0 comments on commit 434def5

Please sign in to comment.