Closed
Description
Describe the problem you are trying to solve
cargo locate-project
and cargo metadata
both return JSON output, which may be easiest when writing programs to parse it, but it is much more difficult to use in simple shell scripts.
Describe the solution you'd like
A --output-format
flag or similar might be the neatest way to solve this. For example, cargo locate-project --output-format minimal
(or something similar) would return just the path to Cargo.toml
. It could also be formatted as root path
or something similar, allowing the use of grep
+ cut
for parsing, and would be more generalizable and allow for future extension locate-project
.
Additionally, this sort of flag could also be extended to other commands and formats, as needed.