Problem: lib+bin crates typically want to exclude the dependencies used for command-line argument parsing when being built in library-only mode. currently this is solved using feature flags, but this either requires everyone installing your package to use cargo install --features cli or everyone using your package as a library to specify default-features = false.
Solution: add a new field, package.default-install-features, for features that should be added to the list of default features when using cargo install.
Downsides:
still requires a fair bit of boilerplate with required-features and such.
only works for cargo install, doing cargo test --bin will still require listing the binaries.
Alternatives:
recommend even trivial crates to use the workspace layout
make argument parsing part of the lib half, like the cargo crate
do nothing, and continue to mildly annoy anyone who tries to use a lib+bin crate
Getting an error about missing required-features feels almost like the tool was spiteful. It gets a clear instruction, it knows exactly what the problem is, it knows the solution, but just won't do it.