[CLI] Report errors for command line options that have no effect #11629
Labels
Projects
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Abstract
The compiler is pretty lax about command-line options whose values it does not use and just ignores many of them. It should report errors instead.
Over time we've started adding checks against this (e.g. #9075, #9364) they they're still very incomplete.
Motivation
Not getting an error when an option is invalid makes it harder for the user to realize that. It's especially problematic with options that seem to make sense together:
--pretty-json
sounds like it would affect--standard-json
but it only works with--combined-json
(#11583.)--bin
should be supported in the assembler mode but currently isn't (#3870).Specification
CommandLineParser
. Basically, all options do not result in a change inCommandLineOptions
in a specific mode should be invalid in that mode.--standard-json
is used. For example:--color
/--no-color
- Standard JSON output is not colorized and even when it will be (#11507), this option should not affect it.--libraries
.--error-codes
.CommandLineParser
but are still not used byCommandLineInterface
.Backwards Compatibility
This does not introduce any backwards-incompatible changes to the language itself but any command-line tools relying on the current behavior of options being ignored will be affected.
The text was updated successfully, but these errors were encountered: