Skip to content

Support glob patterns for crate arguments to --package and --exclude flags #8582

@fitzgen

Description

@fitzgen

Describe the problem you are trying to solve

In workspaces where there are many crates, I would like to only build/test the crates that share the "peepmatic-" name prefix. Or I would like to exclude all of the crates with the "wasmtime-" name prefix.

Describe the solution you'd like

Support glob-style * wildcards for the -p/--package and --exclude flags when building in a workspace, like

$ cargo build --exclude peepmatic-*

Notes

Would help cut down on monstrosities like this:

        cargo +nightly \
            -Zfeatures=all -Zpackage-features \
            test \
            --features test-programs/test_programs \
            --features experimental_x64 \
            --all \
            --exclude lightbeam \
            --exclude peepmatic \
            --exclude peepmatic-automata \
            --exclude peepmatic-fuzzing \
            --exclude peepmatic-macro \
            --exclude peepmatic-runtime \
            --exclude peepmatic-test

We could collapse all those excludes into just --exlude lightbeam --exclude peepmatic*.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cargo-targetsArea: selection and definition of targets (lib, bins, examples, tests, benches)A-cliArea: Command-line interface, option parsing, etc.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

    Issue actions