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

Add --target flag to cargo-rm #711

Merged
merged 6 commits into from
Jun 21, 2022
Merged

Conversation

cassaundra
Copy link
Contributor

@cassaundra cassaundra commented Jun 20, 2022

This PR adds a --target flag to the cargo-rm command in the style of cargo-add's equivalent, with the only difference in usage being that this flag can be used in conjunction with --dev or --build.

In order to correctly handle certain cases with nested tables, Manifest::get_table_mut is split into another function Manifest::get_or_insert_table_mut, with this change being propagated to all other internal usages (e.g. in cargo-add).

@cassaundra cassaundra mentioned this pull request Jun 20, 2022
14 tasks
Copy link
Collaborator

@epage epage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting this going!

src/bin/rm/rm.rs Outdated Show resolved Hide resolved
src/manifest.rs Outdated Show resolved Hide resolved
tests/cmd/rm/invalid_rm_target.toml Show resolved Hide resolved
tests/cmd/rm/invalid_rm_target.in Outdated Show resolved Hide resolved
Now with inserting and erroring (non-inserting) variants
Tests now point to a template `rm-target.in` instead of `rm_target.in`, which
belongs to a test.
src/bin/rm/rm.rs Outdated Show resolved Hide resolved
Opting for the original usage of `conflicts_with` for now.

In the future, this group should only include `--build` and `--dev`.
@epage epage merged commit fdb12eb into killercup:master Jun 21, 2022
@epage
Copy link
Collaborator

epage commented Jun 21, 2022

Thanks! #682 is updated

@cassaundra cassaundra deleted the target-flag branch June 21, 2022 21:41
cassaundra added a commit to cassaundra/cargo-edit that referenced this pull request Jun 28, 2022
This included splitting `Manifest::get_table_mut` into two functions with inserting and erroring (non-inserting) variants to allow for nested lookup for `rm`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants