Skip to content

Add --target flag to cargo-rm#711

Merged
epage merged 6 commits intokillercup:masterfrom
cassaundra:target-flag
Jun 21, 2022
Merged

Add --target flag to cargo-rm#711
epage merged 6 commits intokillercup:masterfrom
cassaundra:target-flag

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!

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.
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