cargo-cmd-0.3.1 is not a library.
cargo-cmd
Alias any shell command in your Cargo.toml
. It's like npm
scripts, but for cargo
.
Installation
Usage
You can define your commands in Cargo.toml
under the [package.metadata.commands]
table, like so:
[]
= "echo 'Hello, planet!'"
Now you can run cargo cmd greet
:
> echo
Advanced use
Passing arguments
It's possible to pass arguments into your command by passing them directly to cargo cmd
.
[]
= "echo"
> echo
Pre and Post commands
You are able to set up commands to run before and after your command by prefixing the name with pre
or post
respectively.
[]
= "./setup.sh"
= "cargo test"
= "./teardown.sh"
> ./setup.sh
> cargo
> ./teardown.sh