-
Notifications
You must be signed in to change notification settings - Fork 331
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
fix: support multiple values after --ignore-files again #1652
fix: support multiple values after --ignore-files again #1652
Conversation
The yargs upgrade from 6.6.0 to 13.2.1 in edebef4 broke the documented ability to pass multiple files to ignore after the `--ignore-files` (aka `-i`) parameter. This is because yargs 11 started to treat `requiresArg` as an implicit `nargs: 1`, i.e. to accept exactly one value only. This patch fixes the issue by dropping `requiresArg` and validating the number of parameters in the `execute` function instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for digging into this issue @Rob--W
The fix for the --ignore-files
option looks good to me.
While I was looking into the changes in this PR I also noticed that:
-
it looks that
--pref
and--start-url
are two other cli options that have changed behavior for the same underlying reason, but it seems that in the MDN docs we never suggested the syntax that has been regressed (it may still be reasonable to keep the behavior consistent across all the "array type" cli options, but not really necessary for proceeding with this PR, we can evaluate that in a follow up issue and/or PR) -
I just noticed that we never included
requiresArgs: true
in the definition of the--arg
cli option, and so it is currently considered valid even if it being used without any parameter (as inweb-ext run -a
), it is not a super big deal, but still something that we should fix (this is also reasonable to be deferred to a separate PR)
The old behavior was not documented, and nobody complained about it, so I guess that we're good to go with supporting one value per flag. I have no strong opinions either way, though based on the fact that it is not possible to easily support
Requiring a parameter for |
@Rob--W I agree, I mentioned both because I noticed them while looking to this change but, as I said, I don't consider neither of them as blocking. |
The yargs upgrade from 6.6.0 to 13.2.1 in edebef4 broke the documented ability to pass multiple files to ignore after the
--ignore-files
(aka-i
) parameter. This is because yargs 11 started to treatrequiresArg
as an implicitnargs: 1
, i.e. to accept exactly one value only.There is an open upstream bug about this issue: yargs/yargs#1098
This patch works around the issue by dropping
requiresArg
and validating the number of parameters in theexecute
function instead.Fixes #1641