Closed weareoutman closed 3 years ago
In the future, don't force push. It makes it impossible for me to see what changed, and I'm forced to re-review all the code.
In the future, don't force push. It makes it impossible for me to see what changed, and I'm forced to re-review all the code.
👌 Sorry for that, force pushed like my daily work and forgot about the review thing.
Just a suggestion, shouldn't the process rather fail with a exit code of 1 instead of 2? 2 is used when outputting the help and could be considered "not an error". Whereas if allowUnknownFlags
is set to false, a unknown flag could be considered an error and thus should fail the process with an 1 insted of a 2?
This assumtion could be backed by the help outputting to stdout, instead of stderr for unknown flags.
Exit code 2 is the convention for invalid flags or other invalid usage: https://stackoverflow.com/questions/1101957/are-there-any-standard-exit-status-codes-in-linux/40484670#40484670
An exit code higher than 1 is AFAIK always an error.
In the future, don't force push. It makes it impossible for me to see what changed, and I'm forced to re-review all the code.
@sindresorhus if you click on the phrase "force-pushed", it will actually show you the diff. Maybe Refined GitHub could make this more intuitive / discoverable.
Neat. I don't think it always did that though.
fix #126
To simplify figuring out which flags are unknown, I tried:
argv._
which starts with-
.And I also make
allowUnknownFlags
betrue
by default to keep compatibility.Let me know if I missed something.