-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
isRequired does not recognize kebab-case flags #165
Comments
The keys in the flags option are expected to be camel-case. |
Thanks, I didn't realize the code matches camelCase flag definitions with kebab-case arguments. The only (minor) consequence is that my help text documents the kebab-case flags, but the isRequired error complains about the missing flag using camelCase. |
Sounds like we need to improve the docs for that.
That is a bug. // @sbencoding |
Thanks. Given the flag is missing, the only way of influencing how it is reported seems to be either defining the flag in the preferred case, or having some Meow option to control the case used for reporting. The former seems simpler to me, and generally Meow seems to work OK if the the flag keys are kebab-case (although probably they then wouldn't match against camelCase flags if that's how they were provided). Any thoughts on how to approach this? I'll contribute if I can. |
Solution:
|
There's a test case (actually it is the first test case in |
|
The
isRequired
option does not seem to work when the flag is defined as kebab-case. I think it's probably looking for the kebab-case key in a map of camelCase flags when it checks to see if it has been provided.Given this test fixture:
This test case fails:
The failure is:
The text was updated successfully, but these errors were encountered: