Add JSON output for tree generation
Is your feature request related to a problem? Please describe. Not related to a problem, just a feature request!
Describe the solution you'd like Add JSON format for tree generation, with a flag that can be passed in to specify the format. Default would be the standard tree ASCII output
Hey, thanks for opening an issue! I think I follow the premise of this idea, but may can you be a little more specific?
-
For tree generation, are you referring the
treesubcommand? -
How would one get the json output? With a new flag like so?
orbit tree --json
- How would the JSON format look with the standard tree ASCII output? An initial idea for a JSON format for this command could be a list of entries, where each entry has a node (design unit identifier) and a list of edges (names of other design unit identifiers that are the dependencies for this design unit). Maybe some thing like this?
[
{
"node": "foo",
"edges": [
"bar"
]
},
{
"node": "bar",
"edges": []
}
]
This way if a user had a separate tool that they wanted to reconstruct the design unit tree with, they can easily do so by processing this output.
Hey! Thanks for the response. Here are my answers to your questions to clarify:
-
I am referring to the
treesubcommand, this would be a new feature that could outputjsoninstead ofascii. -
I think a new flag would be perfect. Originally I was thinking a new argument like
--schemeor something like that, in case there are more formats that want to be added in the future. I got a start on that and basically have configurable schemes with the default beingascii. -
I was curious about your feedback regarding the format of the
jsonoutput and I think what you have there would be great! Like you said, if someone wanted to throw that json output into a tool of their choice, it could be used to make a really nice visualization of the project tree for example.
Thank you for the discussion, the --json flag has now been implemented since 030803455ea57dd0d206bc1fa971a2a04be8252d and this issue will now be closed.