@@ -8,7 +8,11 @@ This tool compares two SPDX3 JSON documents and reports differences in:
88- Kernel configuration parameters (CONFIG_ * )
99- PACKAGECONFIG entries per package
1010
11- It produces both human-readable output (console) and a structured JSON diff file.
11+ The application separates human-readable and machine-readable outputs to improve automation and pipeline integration.
12+
13+ - ** stderr** is used for human-readable (text) output intended for debugging.
14+ - ** stdout** always emits structured ** JSON output** , making it suitable for consumption by scripts and CI/CD pipelines.
15+ - When a JSON filename parameter is provided, the JSON result is also written to the specified file.
1216
1317Usage
1418-----
@@ -21,12 +25,7 @@ Required arguments:
2125 - ` new ` : Path to the newer SPDX3 JSON file.
2226
2327Optional arguments:
24- - ` --output <file> ` : Save diff results to the given JSON file.
25- Default: ` spdx_diff_<timestamp>.json `
26- - ` --format {text,json,both} ` : Control output format:
27- - ` text ` : Console output only (no JSON file)
28- - ` json ` : JSON file only (silent mode for automation)
29- - ` both ` : Both console and JSON output (** default** )
28+ - ` --json-output <file> ` : Save diff results to the given JSON file.
3029
3130Text output filtering - category :
3231 - ` --[no-]packages ` : show|hide package differences.
@@ -128,22 +127,22 @@ The script uses Python's logging module:
128127Examples
129128--------
130129
131- ### Basic comparison with both console and JSON output:
130+ ### Basic comparison with both console(stderr) and JSON(stdout) output:
132131 ./spdx-diff reference.json new.json
133132
134133### Full details with proprietary packages excluded:
135134 ./spdx-diff reference.json new.json --no-packages-proprietary
136135
137- ### Silent mode for CI/CD (JSON output only) :
138- ./spdx-diff reference.json new.json --format json --output results.json
136+ ### Console output for CI/CD:
137+ ./spdx-diff reference.json new.json --quiet
139138
140- ### Console output only (no JSON file) :
141- ./spdx-diff reference.json new.json --format text
139+ ### Console and JSON output with JSON file generated :
140+ ./spdx-diff reference.json new.json --quiet --json-output result.json
142141
143142### Show on console no PACKAGECONFIG differences:
144143 ./spdx-diff reference.json new.json --no-packageconfig
145144
146- Console output example:
145+ Console output(stderr) example:
147146```
148147Packages - Added:
149148 + libfoo: 2.0
0 commit comments