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

Allow enabling/disabling CLI output formatting with an argument #198

Open
lkoskela opened this issue Jan 23, 2025 · 0 comments
Open

Allow enabling/disabling CLI output formatting with an argument #198

lkoskela opened this issue Jan 23, 2025 · 0 comments

Comments

@lkoskela
Copy link
Owner

While indented JSON output is great for a human, for script-based use a more compact JSON output would generally be better.

For example, asking for --indent the output would be nicely formatted JSON (like before):

$ spdx --indent "GPL-3.0"
# => {
#        "expression": {
#            "license": "GPL-3.0-only"
#        },
#        "errors": []
#    }

...but when asking for --compact output, the JSON would exclude any non-meaningful whitespace for a compact, single-line output.

$ spdx --compact "GPL-3.0"
# => {"expression":{"license":"GPL-3.0-only"},"errors":[]}

For backward compatibility, it'd be better to default to --indent to not break any existing usage.

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

No branches or pull requests

1 participant