# Caracall A CLI utility that runs a shell command based on another command's output. Keep in mind it keeps the output from the command you're checking against as well as any commands that it runs on success or error. Also keep in mind this only works on linux :) From `caracall -h`: ``` Usage: caracall [OPTIONS] Arguments: Command that is run and checked against Options: -e Command that is run on stderr -s Command that is run on no stderr -l Extra string to look for -f Command that is run if that string is found -h, --help Print help -V, --version Print version ``` # Install Install cargo, and run `cargo install caracall`. Make sure the cargo binary path is also in your PATH. # Examples A basic showcase of functionality: ```bash # Echo something if grep doesn't find a file, echo something else if it does # Also echo a third thing if it finds what you're grepping for caracall "grep 'kitty' example.txt" \ -s "echo 'found the file!'" \ -e "echo 'didn't find the file!'" \ -l "kitty" -f "echo 'found a kitty :3'" ``` Or a more practical example (this is what I made caracall for): ```bash # Sends a notification to ntfy if a snapraid sync fails. # Open https://ntfy.sh/example and run this command, and a notification should be sent # (Assuming you don't already have snapraid setup on your machine lol) caracall "snapraid sync" \ -e "curl -d 'snapraid sync failed!' ntfy.sh/example" ```