Skip to content
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

Ability to cargo install <dependency>@<version> should update Cargo.toml #6488

Closed
shaunwarman opened this issue Dec 26, 2018 · 1 comment
Closed
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@shaunwarman
Copy link

shaunwarman commented Dec 26, 2018

Warning: New to rust.

Problem
It seems to add a dependency using cargo to my rust project, I need to manually alter Cargo.toml directly. For bootstrapping projects, this seems a bit slow and cumbersome.

Solution
It would be great to just cargo install <dependency>@<version> or cargo install <dep_1> <dep_2> <dep_3> where dependencies 1 thru 3 are installed as the latest and Cargo.toml is updated appropriately.

Instead of README's adding:

# Cargo.toml
[dependencies]
<dependency> = "<version>"

Make it easy for consumers of the crate via:

cargo install --save <dependency>@<version>
@shaunwarman shaunwarman added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Dec 26, 2018
@carols10cents
Copy link
Member

You can do this today with the cargo-edit crate! There are plans to integrate cargo-edit into Cargo proper, which is tracked in #5586, so I'm going to close this in favor of that issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

2 participants