On Arch Linux, among other distros, /bin is a symlink to /usr/bin. This makes cargo list show many components twice:
$ which -a cargo-clippy
/usr/bin/cargo-clippy
/bin/cargo-clippy
$ cargo list | grep clippy
clippy
clippy
It's a little unclear how to fix this though, since cargo would have to know that those two binaries are indeed the same. Resolving symlinks with readlink before de-duplicating here might be the way to go? Alternatively, maybe the list should be de-duplicated based only on the command name, and not on the full path as well. That is, make that BTreeSet a BTreeMap with name as the key. We'd still then have to resolve conflicts, but have to do that today anyway!
As an aside to this, it'd be great if cargo list showed the path of the command it'll use to execute a given component by default. This happens if --verbose is passed currently, but I'm not sure I see the reason to hide it in non-verbose output, given that the command descriptions for built-ins are always shown?
On Arch Linux, among other distros,
/binis a symlink to/usr/bin. This makescargo listshow many components twice:It's a little unclear how to fix this though, since
cargowould have to know that those two binaries are indeed the same. Resolving symlinks withreadlinkbefore de-duplicating here might be the way to go? Alternatively, maybe the list should be de-duplicated based only on the command name, and not on the full path as well. That is, make thatBTreeSetaBTreeMapwithnameas the key. We'd still then have to resolve conflicts, but have to do that today anyway!As an aside to this, it'd be great if
cargo listshowed the path of the command it'll use to execute a given component by default. This happens if--verboseis passed currently, but I'm not sure I see the reason to hide it in non-verbose output, given that the command descriptions for built-ins are always shown?