jpeddicord/askalono

CLI: Return a single JSON object in case of multiple licenses

Closed this issue · 3 comments

In crawl mode, when multiple licenses are found, each license is returned into its own json object.
It would be easier to parse if they were inside the same json object, similar to how licensee is doing.

The CLI could have a single-json-object output format, though I'm not sure it has as much utility as one-object-per-line does today. Outputting JSON objects for each result allows the results to be streamed out instead of waiting for the entire crawl to complete and outputting at the end. Utilities like jq can process line-by-line JSON like this. Is there a particular use case you're after?

Utilities like jq can process line-by-line JSON like this
Yes I used it to test.

I intend to try to incorporate it into a Python script I will be writing, and I thought it would be easier to parse the result as a single object with .json(). I haven't experimented yet so I don't know if that's true.
I just need to extract the file path and the License name.

So I converted the output to a list and then parsed the json line by line. Works as good I guess.