Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--help and --version should work with allowUnknownFlags: false #197

Closed
sindresorhus opened this issue Sep 14, 2021 · 0 comments · Fixed by #215
Closed

--help and --version should work with allowUnknownFlags: false #197

sindresorhus opened this issue Sep 14, 2021 · 0 comments · Fixed by #215

Comments

@sindresorhus
Copy link
Owner

As long as {autoHelp: true} or {autoVersion: true}.

Currently, it fails:

❯ node cli.js --help
Unknown flag
--help

// @weareoutman

msabramo added a commit to msabramo/meow that referenced this issue Sep 15, 2021
Make `--help` and `--version` work with `allowUnknownFlags: false`

Fixes: sindresorhusGH-197
msabramo added a commit to msabramo/chalk-cli that referenced this issue Sep 27, 2021
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 sindresorhus/meow#197), but it's been
taking a while to come up with a proper fix for that (see
sindresorhus/meow#198), so I suggest using this workaround in the
meantime.

See: chalk#32, chalk#33, chalk#39, sindresorhus/meow#197, sindresorhus/meow#198
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant