Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lusingander/cargo-selector
Cargo subcommand to select and execute binary/example targets 📦
https://github.com/lusingander/cargo-selector
cargo cargo-plugin cargo-subcommand ratatui tui
Last synced: about 1 month ago
JSON representation
Cargo subcommand to select and execute binary/example targets 📦
- Host: GitHub
- URL: https://github.com/lusingander/cargo-selector
- Owner: lusingander
- License: mit
- Created: 2024-04-11T08:49:13.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-04-25T13:12:27.000Z (8 months ago)
- Last Synced: 2024-04-30T07:17:31.658Z (8 months ago)
- Topics: cargo, cargo-plugin, cargo-subcommand, ratatui, tui
- Language: Rust
- Homepage: https://lusingander.github.io/cargo-selector/
- Size: 999 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ratatui - cargo-selector - Cargo subcommand to select and execute binary/example targets. (💻 Apps / ⌨️ Development Tools)
README
# cargo-selector
[![Crate Status](https://img.shields.io/crates/v/cargo-selector.svg)](https://crates.io/crates/cargo-selector)
Cargo subcommand to select and execute binary/example targets
(This demo uses [Ratatui](https://github.com/ratatui-org/ratatui) as an example!)
## Installation
```
$ cargo install cargo-selector
```### AUR
```
$ paru -S cargo-selector
```## Usage
```
Usage: cargo selector [OPTIONS]Options:
-i, --inline Display list inline
-n, --inline-list-size List size [default: 10]
-k, --kind 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.
```sh
# 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.
### Keybindings
| Key | Description |
| --------------------------------- | -------------------------------------------- |
| Down Ctrl+n | cursor down |
| Up Ctrl+p | cursor up |
| Enter | execute `cargo run --bin/example ` |
| Tab | switch actions |
| Esc Ctrl+c | quit |## License
MIT