Adds "-h" option to display usage guide
This commit is contained in:
parent
6cb0faca60
commit
3304fde7a3
@ -19,8 +19,11 @@ send-notification.sh "All your base are belong to us"
|
||||
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`
|
||||
|
@ -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
|
||||
|
||||
|
||||
##
|
||||
|
Loading…
Reference in New Issue
Block a user