feat: Adding a json output that surfaces the attributes of the modules #91
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I love this tool, but I needed an easy way to parse the output, so created a json printer. I tried to follow the pattern set up by the tree printer to implement the json output.
cargo fmt
,cargo clippy
, andcargo test
all come back clean.Here is what the output looks like. I didn't pretty print it because one can always use
jq
to format. Also, I didn't wrap the attributes in#[cfg(...)]
like you do in tree. If that's a blocker, I can make that change easy enough. The path is also a full path as that's how it's stored internally. For my consumption, I'm planning to strip that based on the directory in which it was invoked after the fact, but if you'd prefer it to do relative paths, just let me know.