5 releases
new 0.1.4 | Jan 19, 2025 |
---|---|
0.1.3 | Jan 19, 2025 |
0.1.2 | Jan 19, 2025 |
0.1.1 | Jan 18, 2025 |
0.1.0 | Jan 18, 2025 |
#88 in Cargo plugins
360 downloads per month
21KB
468 lines
cargo-q
A Cargo subcommand that allows running multiple Cargo commands in a time.
TODO
- ✅ Add sequential execution
- ✅ Add ; as command separator for independent commands
- ✅ Add & as command separator for dependent commands
- ✅ Add parallel execution between independent commands
- ❌ Add > as command separator for dependent commands
- ❌ Support mixed separators
Installation
cargo install cargo-q
Features
- Run multiple Cargo commands sequentially
- Use different separators for command execution:
- Space: Run commands sequentially (independent execution)
;
: Run independent commands sequentially&
: Run commands with dependencies (each command depends on previous command's success)
- Support parallel execution for independent commands
- Verbose mode for detailed output
Usage
Run a Single Command
cargo q check
Run Multiple Commands
Sequential Execution (Space Separator)
# Run commands sequentially and independently
cargo q "check test" # Runs check, then test
cargo q 'check test' # Single and double quotes both work
Independent Commands (;
Separator)
# Run commands sequentially and independently
cargo q "test --features feature1 ; run" # Commands with parameters need ; separator
Dependent Commands (&
Separator)
# Run commands with explicit dependencies
cargo q "check & test & run" # Each command runs only if previous command succeeds
cargo q "check&test&run" # Spaces around & are optional
Parallel Execution
# Run independent commands in parallel
cargo q -p "build -r; build" # Run both commands in parallel
cargo q --parallel "check; test" # Same as above
Verbose Output
cargo q -v "check test" # Show detailed output
cargo q --verbose "check test" # Same as above
License
Licensed under Apache-2.0 license (LICENSE or http://opensource.org/licenses/Apache-2.0)
Dependencies
~1.1–1.7MB
~32K SLoC