Update tests for lib/opt.sh

This commit is contained in:
Ethan P 2019-09-25 13:19:51 -07:00
parent 6e8959b1d6
commit e15b9d439a
No known key found for this signature in database
GPG Key ID: 6963FD04F6CF35EA
2 changed files with 5 additions and 3 deletions

View File

@ -1,7 +1,5 @@
set -e
source "${DIR_LIB}/opt.sh"
setargs pos1 \
set - pos1 \
--val1 for_val1 \
--val2=for_val2 \
pos2 \
@ -9,7 +7,10 @@ setargs pos1 \
-v4 for_val4 \
--flag2 \
source "${DIR_LIB}/opt.sh"
# Run a standard option parsing loop.
echo "PROGRAM: $PROGRAM"
while shiftopt; do
case "$OPT" in
--val*) shiftval; printf "LONG_OPTION: \"%s\" with value \"%s\"\n" "${OPT}" "${OPT_VAL}" ;;

View File

@ -1,3 +1,4 @@
PROGRAM: lib.opt
ARGUMENT: "pos1"
LONG_OPTION: "--val1" with value "for_val1"
LONG_OPTION: "--val2" with value "for_val2"