Skip to content

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

@cameel

Description

@cameel

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions