Skip to content

Commit

Permalink
Fix broken --help flag
Browse files Browse the repository at this point in the history
Currently, `allowUnknownFlags: false` is commented out, which is not
ideal, because the error message the user gets when using an unknown
flag is pretty confusing:

```
$ chalk --foobar
Input required
```

The actual problem is in meow (see meow#197), but it's been taking a
while to come up with a proper fix for that (see meow#198), so I suggest
using this workaround in the meantime.

See: chalk#32, chalk#33, chalk#39, meow#197, meow#198
  • Loading branch information
msabramo committed Sep 27, 2021
1 parent b04fefc commit c046822
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ const cli = meow(`
$ echo 'Unicorns from stdin' | chalk --stdin red bold
`, {
importMeta: import.meta,
// TODO: Disabled until https://github.com/sindresorhus/meow/issues/197 is fixed.
// allowUnknownFlags: false,
allowUnknownFlags: false,
flags: {
// TODO: Can be removed when https://github.com/sindresorhus/meow/issues/197 is fixed.
help: {type: 'boolean'},
version: {type: 'boolean'},

template: {
type: 'string',
alias: 't',
Expand Down

0 comments on commit c046822

Please sign in to comment.