Description
Problem
When examining dependencies with cargo tree
, there is no way to print the library name
, which can be different from the package name
, as seen here, in piston2d-graphics' manifest. A programmer using this in her own code would go:
use graphics;
but graphics
would not appear in the output of cargo tree
, leading to confusion.
Proposed solution
I propose adding a new formatting control character, {n}
, that would print out the library name
, which defaults to the package name and of which there can be only one per package.
If I had a project that declared piston2d-graphics as a dependency in its Cargo.toml, and I called cargo tree like cargo tree --format '{p} ({n})'
, I would expect the output for the line that corresponded to piston2d-graphics to look like:
├── piston2d-graphics v0.56.0 (graphics)
Notes
The currently supported formatting characters are:
{p} — The package name.
{l} — The package license.
{r} — The package repository URL.
{f} — Comma-separated list of package features that are enabled.
If {l}
were not already used for the license, I would propose that as the new control character.