Skip to content

Commit

Permalink
docs: note about parse() callback output parameter contents (yargs#1407)
Browse files Browse the repository at this point in the history
  • Loading branch information
mleguen authored and bcoe committed Aug 22, 2019
1 parent 8792d13 commit b7ec0df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ A `parseCallback` can also be provided to `.parse()`. If a callback is given, it

1. `err`: populated if any validation errors raised while parsing.
2. `argv`: the parsed argv object.
3. `output`: any text that would have been output to the terminal, had a
3. `output`: any text that would have been output by yargs to the terminal, had a
callback not been provided.

```js
Expand All @@ -1138,6 +1138,10 @@ parser.parse(bot.userText, function (err, argv, output) {

***Note:*** Providing a callback to `parse()` disables the [`exitProcess` setting](#exitprocess) until after the callback is invoked.

***Note:*** the `output` parameter of a `parse()` callback only contains text output by yargs using its internal logger.
It *does not* include any text output by user-supplied callback, such as `console.log()` outputs in a
command handler, for example.

<a name="parsed"></a>.parsed
------------
If the arguments have not been parsed, this property is `false`.
Expand Down

0 comments on commit b7ec0df

Please sign in to comment.