Crates.io | cargo-select |
lib.rs | cargo-select |
version | 0.2.3 |
source | src |
created_at | 2022-06-18 16:09:25.486447 |
updated_at | 2022-08-24 18:51:42.268438 |
description | Cargo subcommand to easily run targets/examples/tests |
homepage | |
repository | https://github.com/LoipesMas/cargo-select |
max_upload_size | |
id | 608591 |
size | 59,509 |
Fuzzy match against targets, examples or tests in current rust project.
cargo-select 0.2.0
LoipesMas
Fuzzy-match targets/examples
USAGE:
cargo select [OPTIONS] [ARGS]
ARGS:
<CARGO_COMMAND> Cargo command to run with selected target (e.g. "run").
<PATTERN> Pattern to fuzzy-match targets with. Omit for interactive mode.
<CARGO_ARGS>... Additional arguments to pass to cargo.
OPTIONS:
-h, --help Print help information
--no-skip Run all tests that match selected test (i.e. dont skip names that are
supersets)(tests only)
-V, --version Print version information
cargo select run
is special-cased to cargo run
with --package NAME
or --example NAME
.
cargo select test
is special-cased to match against test names (deduced from source files) and run them with cargo test
.
Alternatives:
cargo test NAME
, but it doesn't let you find tests by name and doesnt work well with workspacescargo test -- --list | fzf | sed "s/: .*//" | xargs cargo test -- --exact
, but it requires compiling the tests which can take a lot of time and disk space on some projects (especially ones with a few workspaces). And it still has some limitations.cargo install cargo-select
git clone https://github.com/LoipesMas/cargo-select.git
cd cargo-select
cargo install --path .