Update script template
This commit is contained in:
parent
21b953f274
commit
feab6634b2
|
|
@ -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 "${@}"
|
||||
Loading…
Reference in New Issue