cargo-commander-0.1.15 is not a library.
Cargo Commander
The simple way of running commands
Introduction
Cargo Commander serves to fill the gap in the cargo commands capabilities, namely not being able to run commands in a
similar fashion that npm does with scripts.
Getting started
Either create your commands under a [commands] section in your Cargo.toml file, or create a new
Commands.toml file which uses the exact same syntax as if it had been under the commands section.
# Install cargo-commander
cargo install cargo-commander
# Run your command
cargo cmd COMMAND
How to use
Read the full guide in our wiki.
A command can either be a string or a command object using the below fields to customize its behavior.
cmd = String or Array, where an array can either contain string commands or other command objects
parallel = true/false, only makes a difference if the command object contains an array, makes all commands run in parallel
shell = String, the syntax is simply "program arg arg arg"
env = Array, an array of strings in the format "VAR=SOMETHING"
args = Array, an array of strings in the format "ARG=Default value", if no default is given an empty string is used
Here are some examples of how you can set up commands.
# Cargo.toml
[]
= "echo world"
= ["echo first", "echo second"]
= { = "print('Hello from python!')", = "python -c" }
[]
= "echo test"
= { = "echo $ARG1 $ARG2", = ["ARG1", "ARG2=Default value"] }
= { = ["echo $MY_ENV"], = ["MY_ENV=Hello"] }
= { = ["echo $MY_ENV $ARG"], = ["MY_ENV=Hello"], = ["ARG=Default"] }
# Commands.toml
= "echo world"
= { = [
"echo we",
"echo run",
"echo in",
"echo parallel"
], = true }
[]
= "git status"
If you want to see more examples, check out the Commands.toml file in the repository.