-
Notifications
You must be signed in to change notification settings - Fork 153
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
Feature request: Add features using crate+feat1+feat2
syntax.
#592
Comments
Its an intriguing idea, in particular because it allows you to add multiple crates ( One question I have is how to tell when a
We could do the equivalent of And one concern is if we are getting too magical / custom in syntax. We are working on finalizing the CLI for cargo which gives us less room for experimentation. We could put this behind an unstable feature flag. |
Yeah, I think your solution makes sense. Crates are forbidden to have It would prevent something like Double checking, the current syntax doesn't allow for
That makes sense. If we get agreement on the syntax, whether with the space separator or the |
btw I posted on the internals thread for reviewing cargo-adds CLI about this proposal to solicit more feedback. |
Under `-Zinline-add`, we now support a `cargo feature`-like syntax of `+feature`. This allows `cargo add serde +derive serde_json`. Benefits - We become less reliant on modality - Single-line getting started - Shorter syntax Fixes killercup#592
Under `-Zinline-add`, we now support a `cargo feature`-like syntax of `+feature`. This allows `cargo add serde +derive serde_json`. Benefits - We become less reliant on modality - Single-line getting started - Shorter syntax Fixes #592
Currently, users can specify features with the
--features
option, like so:I think it's much easier as an end user to remember a syntax like the following for adding features:
This supports multiple features, as in:
This syntax has the additional benefit that users can associate features on a per crate basis, enabling invocations like this:
I implemented this in a fork: https://github.com/kurtbuilds/cargo-edit But it needs to be updated, as there are code conflicts now.
Is there openness to merging/re-implementing this feature into mainline?
It should be entirely backwards compatible, since the
--feature
can continue to be supported, and no packages have+
in their name.I know there's the
cargo-feature
tool, but it seems like a worse approach to have a separate invocationcargo feature ...
when adding features vs adding packages.The text was updated successfully, but these errors were encountered: