Skip to content

tmtmtoo/cx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cx

Test Release

A simple command executor utility.

Command eXecutor

USAGE:
    cx <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    help         Prints this message or the help of the given subcommand(s)
    retry        Retry command execution until successful.
    supervise    Supervise command execution.

Retry

Retry command execution until successful.

USAGE:
    cx retry [OPTIONS] [COMMAND]...

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -c, --count <count>          maximum number of retry counts
    -i, --interval <interval>    execution interval (sec) [default: 0.1]

ARGS:
    <COMMAND>...    command and options

example

$ cx retry -c 3 -i 2 -- your command that may fail && echo succeeded || echo failed

Supervise

Supervise command execution.

USAGE:
    cx supervise [OPTIONS] [COMMAND]...

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -c, --count <count>          re-execution limit counts
    -i, --interval <interval>    execution interval (sec) [default: 0.1]

ARGS:
    <COMMAND>...    command and options

example

$ cx supervise -c 3 -i 2 -- echo abc