mirror of
https://github.com/kvz/bash3boilerplate.git
synced 2024-12-18 22:27:51 +00:00
Allow adding a help that is not parsed. See #24
This commit is contained in:
parent
b71ca507ab
commit
5ee427eef5
7
main.sh
7
main.sh
@ -64,6 +64,11 @@ read -r -d '' __usage <<-'EOF' || true # exits non-zero when EOF encountered
|
||||
-n --no-color Disable color output
|
||||
-1 --one Do just one thing
|
||||
EOF
|
||||
read -r -d '' __helptext <<-'EOF' || true # exits non-zero when EOF encountered
|
||||
This is Bash3 Boilerplate's help text. Feel free to add any description of your
|
||||
program or elaborate more on command-line arguments. This section is not
|
||||
parsed and will be added as-is to the help.
|
||||
EOF
|
||||
|
||||
# Set magic variables for current file and its directory.
|
||||
# BASH_SOURCE[0] is used so we can display the current file even if it is sourced by a parent script.
|
||||
@ -113,6 +118,8 @@ function help () {
|
||||
echo "" 1>&2
|
||||
echo " ${__usage}" 1>&2
|
||||
echo "" 1>&2
|
||||
echo " ${__helptext}" 1>&2
|
||||
echo "" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user