diff --git a/script b/script index 47703b1..935c8ae 100755 --- a/script +++ b/script @@ -1,7 +1,22 @@ #!/bin/sh usage() { - printf "Usage: %s [options]\n" "$0" + printf "Usage: %s [-h]\n" "$0" +} + +help() { + cat << EOH + SYNOPSIS + $0 [-h] + + DESCRIPTION + + $0 does things! + + OPTIONS + + -h Show this help +EOH } on_interrupt() { @@ -13,7 +28,7 @@ on_interrupt() { main() { while getopts "hf:" option; do case "${option}" in - h) usage; exit 0;; + h) help; exit 0;; f) FOO="$OPTARG";; *) usage; exit 1;; esac