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

Make --pretty-json work with Standard JSON output #11583

Closed
cameel opened this issue Jun 26, 2021 · 1 comment · Fixed by #11639
Closed

Make --pretty-json work with Standard JSON output #11583

cameel opened this issue Jun 26, 2021 · 1 comment · Fixed by #11639

Comments

@cameel
Copy link
Member

cameel commented Jun 26, 2021

By default the compiler prints any JSON output in a compact form:

echo "contract C {}" | solc - --combined-json abi
{"contracts":{"<stdin>:C":{"abi":[]}},"version":"0.8.6+commit.11564f7e.Linux.g++"}

You can use --pretty-json option to get nicely indented output from --combined-json option:

echo "contract C {}" | solc - --combined-json abi --pretty-json
{
  "contracts":
  {
    "<stdin>:C":
    {
      "abi": []
    }
  },
  "version": "0.8.6+commit.11564f7e.Linux.g++"
}

This does not work with --standard-json. Make --pretty-json affect it too.

Optionally, it would also be nice if you could specify the indent size for the option to make the output easier to read (e.g. --pretty-json 4).

@cameel
Copy link
Member Author

cameel commented Jun 26, 2021

Once this is done, we could also make test/cmdlineTest.sh use that option to print test output in a more readable way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant