Skip to content

Allow passing multiple crate names to cargo new #9823

@jyn514

Description

@jyn514

Describe the problem you are trying to solve
cargo new a b c gives an error:

error: Found argument 'b' which wasn't expected, or isn't valid in this context

USAGE:
    cargo new <path> --lib

Describe the solution you'd like
Allow passing multiple crates at the same time. Right now I do this with xargs, which works but is annoying to remember.

$ echo inner middle outer | xargs -n1 cargo new --lib
     Created library `inner` package
     Created library `middle` package
     Created library `outer` package

Notes

$ cargo --version
cargo 1.56.0-nightly (e96bdb0c3 2021-08-17)

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions