Update script template

This commit is contained in:
Joshua Yuen 2025-07-31 01:38:45 -04:00
parent 21b953f274
commit feab6634b2
Signed by: josh
GPG Key ID: 502720BC22ED411C
1 changed files with 8 additions and 8 deletions

View File

@ -68,19 +68,19 @@ die() {
needs_arg() {
if [ -z "${OPTARG}" ]; then
>&2 echo "${0}: option requires an argument -- ${OPT}"
to_stderr "${0}: option requires an argument -- ${OPT}"
usage
die
fi
}
usage() {
echo
echo "Template script."
echo
to_stdout
to_stdout "Template script."
to_stdout
to_stdout "${bld}Usage:${nc}"
to_stdout " ${dim}\$${nc} ${script_name}"
echo
to_stdout
to_stdout "${bld}Options:${nc}"
cat <<EOF | column -tds '|'
-e, --error|Exit with error
@ -129,12 +129,12 @@ main() {
done
debug "Start of main"
echo "This is a template."
info "This is a template."
if [ -n "${OPTION}" ]; then
debug "Option is not empty"
echo "Option is set to: ${OPTION}"
debug "Option is set to: ${OPTION}"
fi
}
main "$@"
main "${@}"