Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add ability to pass through flags to underlying cargo subcommand #286

@cyphar

Description

@cyphar

While some commands make sense for cargo-hack to parse itself (--features being the obvious one), I have run into issues where cargo-hack happens to use the same flag name as a sub-command I am trying to run.

For a specific example, I was trying to use nextest's --partition flag to partition the actual tests being run, but because cargo-hack has its own --partition flag I cannot use it:

% cargo hack --feature-powerset --features=capi nextest run --partition=hash:1/10
error: bad or out-of-range partition: hash:1/10

I would expect -- to be the standard solution to fix this, but no matter where you put it you get an error AFAICS. (In my case I'm actually using cargo-llvm-cov as well so the flag parsing gets even more complicated.)

Is there a correct way of solving this problem today, and if not can there either be better support for -- or a new --args flag that lets you specify flags to pass down unparsed to the underlying subcommand?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions