diff --git a/Cargo.toml b/Cargo.toml index 94eaafc..0e33532 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,6 @@ anyhow = "1.0.95" clap = { version = "4.5.23", features = ["derive"] } ctrlc = "3.4.5" dirs = "5.0.1" -duct = "0.13.7" futures = "0.3.31" lettre = "0.11.11" mail-send = "0.4.9" diff --git a/README.md b/README.md index 5481f99..4fc8ed1 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,74 @@ -
-⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡀⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣿⣿⠆⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⡿⠁⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⠟⠀⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⡿⠃⠀⠀⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣾⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀ -⠀⢀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⠏⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠺⣿⣷⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠈⠻⣿⣿⣦⣄⠀⠀⠀⠀⠀⠀⣠⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠀⠀⠈⠻⣿⣿⣷⣤⡀⠀⠀⣰⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣦⣼⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⡟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - - -Usage: completion-notifier [OPTIONS]- - -## config - -```markdown +# Completion Notifier + +A simple notifier to send notifications on terminal process events. + + +## Installation + +Install directly from source + +```bash + $ git clone https://github.com/n3tw0rth/completion-notifier.git + $ cd completion-notifier + $ ./install.sh + + $ completion-notifier -v + $ completion-notifier -h +``` + +it is better to use a alias for the binary, +```bash +#.bashrc +alias notif='completion-notifier' +``` +## Usage + +It is easy as passing the command directly, by default a notification will be send once the program completes execution success or failed. + +```shell +$ completion-notifier ping google.com +``` +### Triggers +Triggers can be added to send custom notifications based on the requirement. for example, + +```shell +$ completion-notifier -t PING ping google.com +``` +program will start running as usual, and will send additionals notifications before process exit. Based on the string values passed into the `-t` flag. According to this example a notification will be send when program find a specific line contain the word `PING`. + +```shell +$ completion-notifier -t approve,'Enter a value' terraform apply +``` +flag `-t` will accept comma seperated values, and trigger values containing more words seperated by spaces they can be passed in as shown. In this example user will be notified when there undefined variables and when terraform ask for user confirmation to apply the change. +## Configuration + +```toml [email.default] -from = "" -to = "" -api_key = "" -port = 587 +from = "acme@dev.com" +to = "me@dev.com" +username = "" +password = "" +port = 465 +host = "" + +[email.work] +from = "acme@dev.com" +to = "pm@dev.com" +username = "" +password = "" +port = 465 host = "" [profiles.default] print_output = true -sendto = ["email.default"] +sendto = ["desktop","email.default"] -[gchat.default] +[profiles.work] +print_output = true +sendto = ["desktop","gchat.work","email.work"] + +[gchat.work] api_key = "" webhook = "" + ```... - -Arguments: - ... - -Options: - -p, --profiles [default: default] - -n, --name - -t, --triggers - -v, --verbose - -h, --help Print help - -V, --version Print version - -