src: add validation for CLI options that don't take an argument#59584
src: add validation for CLI options that don't take an argument#59584npaun wants to merge 1 commit intonodejs:mainfrom
Conversation
ce5397e to
7bf98eb
Compare
dario-piotrowicz
left a comment
There was a problem hiding this comment.
Looks good to me 😄
But ideally some tests should be added for this 🙂
7bf98eb to
804d180
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #59584 +/- ##
==========================================
+ Coverage 89.83% 89.84% +0.01%
==========================================
Files 666 666
Lines 195337 195341 +4
Branches 38353 38358 +5
==========================================
+ Hits 175474 175511 +37
+ Misses 12323 12296 -27
+ Partials 7540 7534 -6
🚀 New features to boost your workflow:
|
|
@npaun There are tests failures, the problem being that there are tests that pass a boolean to the I think you need to update the line I shared above not to include the Anyways the above worries me a bit because I can imagine users also potentially (and incorrectly) using (Alternatively the change here could be made to accept |
|
This pull request has been marked as stale due to 210 days of inactivity. |
Certain command-line options don't take an argument. Among them are
--watchand--check. However, as @dario-piotrowicz points out in #57864, Node's argument parser will silently accept an argument for boolean flags, admitting inputs like--watch=this-value-should-not-be-here.js, which creates user confusion.In this PR, I worked together with @dario-piotrowicz to add an error message if an argument is mistakenly provided for boolean flags.