mirror of
https://github.com/kvz/bash3boilerplate.git
synced 2024-12-22 07:47:48 +00:00
1e69fd5e21
replaced all `eval` with `printf -v` for security reasons. the behaviour of unset without -v/-f is actually undefined so make the intent clear.
34 lines
1.1 KiB
Bash
Executable File
34 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -o pipefail
|
|
set -o errexit
|
|
set -o nounset
|
|
# set -o xtrace
|
|
|
|
# Set magic variables for current FILE & DIR
|
|
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
|
|
__base="$(basename ${__file} .sh)"
|
|
__root="$(cd "$(dirname $(dirname $(dirname "${__dir}")))" && pwd)"
|
|
|
|
# Set __usage and source main.sh
|
|
read -r -d '' __usage <<-'EOF' || true # exits non-zero when EOF encountered
|
|
-1 --one Do one thing. Default="ONE"
|
|
More description.
|
|
-2 --two Do two things.
|
|
More description. Default="TWO"
|
|
-3 --three [arg] Do three things. Default="'THREE'"
|
|
More description.
|
|
-4 --four [arg] Do four things.
|
|
More description. Default='"FOUR"'
|
|
-5 --five [arg] Do five things. Default="FIVE"
|
|
More description. Default='OOOPS'
|
|
-6 --six [arg] Do six things.
|
|
More description.
|
|
EOF
|
|
|
|
echo "ACCPTST:STDIO_REPLACE_DATETIMES"
|
|
|
|
source "${__root}/main.sh"
|
|
|
|
for argument in ${!arg_*}; do info "${argument}: ${!argument}"; done
|