-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support a shorthand for specifying features when cargo add
ing multiple crates
#10809
Comments
This comment was marked as resolved.
This comment was marked as resolved.
For background, before
In summary, the main reason we removed it was |
@epage That sounds better, but it's still not possible(?) to specify both crate name and feature in one go, i.e. the crate name is still required twice. Would like a way to specify a crate with features just so it's faster, since I create new crates quite often.
This makes sense, but I want to ask, is the new functionality proposed here or the |
Still pending. We have not brought the subject up again. For myself, I would want to a better idea of the scope of people who are wanting to do these more involved |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
cargo-add
cargo add
ing multiple crates
I implemented the https://github.com/kurtbuilds/cargo If there's interest, I can create a PR to merge. |
We are not blocked on implementation (this previously existed in the cargo-add version). See my previous comment
|
Multiple features could be specified by repeating the crate name (again same as |
Is this ticket still relevant? I'm able to install packages and features like this: cargo add thiserror tokio argon2 axum-extra tracing tracing-subscriber serde secrecy \
-F 'serde/derive' -F 'secrecy/serde' -F 'tracing-subscriber/env-filter' -F 'tokio/full' \
-F argon2/std -F axum-extra/cookie -F axum-extra/cookie-signed It would be nice to provide an example on the cargo add page for multiple crates with multiple features |
This issue is about having a short hand
We do have |
Problem
cargo add
can be a bit annoying when specifying features for multiple crates. For example:cargo add serde sqlx --features serde/derive sqlx/postgres
fails witherror: invalid character `/` in dependency name: `sqlx/postgres`, characters must be Unicode XID characters (numbers, `-`, `_`, or most letters)
It's necessary to use one of
But those methods are also cumbersome in having to specify the crate name multiple times
Proposed Solution
It would be useful to have a shorthand for specifying features, whether
cargo add serde[derive] sqlx[postgres,sqlite]
cargo add sqlx[-default,postgres,sqlite]
cargo add
:cargo add serde +derive sqlx +postgres +sqlite
cargo add serde -F derive sqlx -F postgres -F sqlite
Notes
No response
The text was updated successfully, but these errors were encountered: