diff --git a/README.md b/README.md index 8d4a0a6..bd66e6b 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,14 @@ send-notification.sh "All your base are belong to us" ``` ``` - uptime | send-notification.sh +uptime | send-notification.sh ``` +See `send-notification.sh -h`. + ### Configuration : +Script can be configured Edit `send-notification.sh` and set the following variables: * `USER_LOGIN` diff --git a/send-notification.sh b/send-notification.sh index f22de58..cda4383 100644 --- a/send-notification.sh +++ b/send-notification.sh @@ -8,10 +8,25 @@ # # NĂ©cessite: sed, sh et wget # -# Possible usages: -# send-notification.sh "All your base are belong to us" -# echo "All your base are belong to us" | send-notification.sh -# uptime | send-notification.sh +# Possible usages: see usage_help() + + +readonly PROGNAME=$(basename $0) + +usage_help () { + echo "Possible usages:" + echo "* ${PROGNAME} [options] [message]" + echo "* echo \"All your base are belong to us\" | ${PROGNAME} [options]" + echo "" + echo "Options:" + echo "* -h display this help" +} + +while getopts "h" option; do + case "$option" in + h) usage_help ; exit 0 ;; + esac +done ##