feat(help): add help function
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Simon Vieille 2023-01-08 15:18:23 +01:00
parent fa3c7844cb
commit 374ac3aeb9
1 changed files with 17 additions and 2 deletions

19
script
View File

@ -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