Add JSON output capabilities#21
Add JSON output capabilities#21Twey wants to merge 1 commit intosfackler:masterfrom hadeaninc:master
Conversation
| --charset CHARSET Set the character set to use in output. Valid | ||
| values: utf8, ascii [default: utf8] | ||
| -f, --format FORMAT Format string for printing dependencies | ||
| -j, --json Print a JSON representation of the tree |
There was a problem hiding this comment.
I think it'd make sense to match the --output-format flag that Cargo uses, and make the JSON representation compatible with that.
| nodes: HashMap<&'a PackageId, NodeIndex>, | ||
| } | ||
|
|
||
| #[derive(Debug, Serialize, Deserialize)] |
There was a problem hiding this comment.
No need to implement Deserialize I don't think.
| } | ||
| } else if flags.flag_json { | ||
| println!("{}", serde_json::to_string_pretty( | ||
| &graph_to_tree(package.package_id(), |
There was a problem hiding this comment.
It seems a bit strange that this mode would ignore a bunch of the flags the other modes respect.
|
Have you taken a look at |
|
Unfortunately |
|
What do you mean by resolved features? I would kind of like to keep this project focused on user-facing output. |
I needed this to be able to output JSON for parsing elsewhere.