Skip to content

cargo new: automatically add to workspace #10670

Closed
@theduke

Description

@theduke

Problem

When running cargo new in a workspace a warning is printed, but you have to manually add the new crate to the members = [] section.

Proposed Solution

Add a new --workspace / -w flag to cargo new that automatically adds the new crate with the correct path to members.

Print a hint about the flag when cargo new is run in a workspace.

This is admittedly a small quality of life feature, but I do it often enough that it becomes annoying.

Activity

added
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
on May 15, 2022
ehuss

ehuss commented on May 15, 2022

@ehuss
Contributor

Thanks for the report. This is a known issue, closing as a duplicate of #8365.

theduke

theduke commented on May 15, 2022

@theduke
Author

@ehuss these are two different requests.

The other issue is about creating an empty workspace.

This issue is about automatically modifying the members declaration in a workspace when running 'new' inside a workspace.

ehuss

ehuss commented on May 15, 2022

@ehuss
Contributor

Sorry, I should have linked to #6378.

felipetesc

felipetesc commented on Oct 5, 2022

@felipetesc

Any news about this proposal ? What's the current situation ? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ehuss@theduke@felipetesc

        Issue actions

          cargo new: automatically add to workspace · Issue #10670 · rust-lang/cargo