Crates.io | cargo-selector |
lib.rs | cargo-selector |
version | 0.4.1 |
source | src |
created_at | 2024-04-11 08:46:07.616019 |
updated_at | 2024-08-08 12:28:13.084015 |
description | Cargo subcommand to select and execute binary/example targets |
homepage | https://github.com/lusingander/cargo-selector |
repository | https://github.com/lusingander/cargo-selector |
max_upload_size | |
id | 1204600 |
size | 42,060 |
Cargo subcommand to select and execute binary/example targets
(This demo uses Ratatui as an example!)
$ cargo install cargo-selector
$ paru -S cargo-selector
Usage: cargo selector [OPTIONS]
Options:
-i, --inline Display list inline
-n, --inline-list-size <SIZE> List size [default: 10]
-k, --kind <NAME> Target kind [possible values: bin, example]
-h, --help Print help
-V, --version Print version
Run the command in the cargo project directory:
$ cargo selector
Then, target list will be displayed, and you can execute the following command by selecting it.
# if the target is bin
$ cargo run --bin xyz [--features "foo bar"]
# if the target is example
$ cargo run --example xyz [--features "foo bar"]
By switching the action, you can also run only the build.
Key | Description |
---|---|
Down Ctrl+n | cursor down |
Up Ctrl+p | cursor up |
Enter | execute cargo run --bin/example <selected> |
Tab | switch actions |
Esc Ctrl+c | quit |
MIT