mirror of
https://github.com/eth-p/bat-extras.git
synced 2024-11-08 00:34:22 +01:00
Update tests for lib/opt.sh
This commit is contained in:
parent
6e8959b1d6
commit
e15b9d439a
@ -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}" ;;
|
||||
|
@ -1,3 +1,4 @@
|
||||
PROGRAM: lib.opt
|
||||
ARGUMENT: "pos1"
|
||||
LONG_OPTION: "--val1" with value "for_val1"
|
||||
LONG_OPTION: "--val2" with value "for_val2"
|
||||
|
Loading…
Reference in New Issue
Block a user