Skip to content
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

[CLI] Report errors for command line options that have no effect #11629

Open
cameel opened this issue Jul 7, 2021 · 0 comments
Open

[CLI] Report errors for command line options that have no effect #11629

cameel opened this issue Jul 7, 2021 · 0 comments

Comments

@cameel
Copy link
Member

@cameel cameel commented Jul 7, 2021

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

  • There are several input modes (compiler, linker, assembler, standard JSON) and many options are not valid in one of these modes. The invalid ones should produce an error.
  • Options that have equivalents and Standard JSON should be errors when --standard-json is used. For example:
    • Model checker settings.
    • Remappings.
    • --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.
  • Please also check options whose values are not ignored by CommandLineParser but are still not used by CommandLineInterface.

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.

@cameel cameel added this to New issues in Solidity via automation Jul 7, 2021
@cameel cameel added this to To do in SOLC Overhaul via automation Jul 7, 2021
@ethereum ethereum deleted a comment from CRYONE7 Jul 9, 2021
@cameel cameel changed the title Report errors for command line options that have no effect [CLI] Report errors for command line options that have no effect Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Solidity
  
New issues
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant