Add test for longopt parsing

This commit is contained in:
Kevin van Zonneveld 2016-02-16 22:05:11 +01:00
parent df3d535ab1
commit 56721e9cd5
4 changed files with 27 additions and 0 deletions

View File

@ -217,6 +217,11 @@ else
info "You are on Linux"
fi
info "arg_f: ${arg_f}"
info "arg_d: ${arg_d}"
info "arg_v: ${arg_v}"
info "arg_h: ${arg_h}"
debug "Info useful to developers for debugging the application, not useful during operations."
info "Normal operational messages - may be harvested for reporting, measuring throughput, etc. - no action required."
notice "Events that are unusual but not error conditions - might be summarized in an email to developers or admins to spot potential problems - no immediate action required."

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1,4 @@
B3BP:STDIO_REPLACE_DATETIMES
{datetime} UTC [ info] arg_f: {tmpdir}/x
{datetime} UTC [ info] arg_f: {tmpdir}/x
{datetime} UTC [ info] arg_f: {tmpdir}/x

View File

@ -0,0 +1,17 @@
#!/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)"
echo "B3BP:STDIO_REPLACE_DATETIMES"
(env LOG_LEVEL=6 bash "${__root}/main.sh" --file /tmp/x;
env LOG_LEVEL=6 bash "${__root}/main.sh" --file=/tmp/x;
env LOG_LEVEL=6 bash "${__root}/main.sh" -f /tmp/x) 2>&1 |grep arg_f