cargo-repeat

Crates.iocargo-repeat
lib.rscargo-repeat
version0.1.0
sourcesrc
created_at2022-04-10 00:45:38.394709
updated_at2022-04-10 00:45:38.394709
descriptionRepeats a command until it exits with the right code
homepagehttps://seranth.github.io/cargo-repeat/
repositoryhttps://github.com/seranth/cargo-repeat
max_upload_size
id564913
size12,407
Simon Hyll (simonhyll)

documentation

https://github.com/seranth/cargo-repeat/wiki

README

cargo-repeat

Repeats a command until it exits with the right code

Introduction

This crate is a nice little utility function that lets you repeat a command indefinitely until it matches a certain exit code (default 0).

Usage

# Output of cargo repeat --help
cargo-repeat 0.1.0
Repeats a command until it exits with the right code

USAGE:
    cargo-repeat.exe [OPTIONS] [-- <TARGET>...]

ARGS:
    <TARGET>...    Command and arguments to repeat

OPTIONS:
    -c, --code <i32>     Exit code to repeat until it's hit [default: 0]
    -h, --help           Print help information
    -s, --sleep <f64>    Delay between retries [default: 1]
    -v, --verbose        Verbose
    -V, --version        Print version information

Examples

# Keeps saying "hello world" until it exits with a 0 status
cargo repeat -- echo "hello world"

# Will keep running "python test.py" until it exits with status 5
cargo repeat -c 5 -- python test.py

# Keeps saying "hello" with a 0.5 second delay
cargo repeat -s 0.5 -- echo "hello" 

# Says hello and outputs some statistics at the end
cargo repeat -v -- echo "hello"
Commit count: 3

cargo fmt