mirror of
https://github.com/cuberite/TCLAP.git
synced 2025-08-04 02:06:29 -04:00
updated for - arg bug
This commit is contained in:
parent
1788e8e05a
commit
c297a6bf5f
@ -53,7 +53,9 @@ TESTS = test1.sh \
|
||||
test51.sh \
|
||||
test52.sh \
|
||||
test53.sh \
|
||||
test54.sh
|
||||
test54.sh \
|
||||
test55.sh \
|
||||
test56.sh
|
||||
|
||||
EXTRA_DIST = $(TESTS) \
|
||||
test1.out \
|
||||
@ -109,5 +111,7 @@ EXTRA_DIST = $(TESTS) \
|
||||
test51.out \
|
||||
test52.out \
|
||||
test53.out \
|
||||
test54.out
|
||||
test54.out \
|
||||
test55.out \
|
||||
test56.out
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# success
|
||||
../examples/test3 -s=bill -i=9 -i=8 -B homer marge bart > tmp.out 2>&1
|
||||
../examples/test3 --stringTest=bill -i=9 -i=8 -B homer marge bart > tmp.out 2>&1
|
||||
|
||||
if cmp -s tmp.out test13.out; then
|
||||
exit 0
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# success
|
||||
../examples/test3 -s=aaa homer marge bart -- one two > tmp.out 2>&1
|
||||
../examples/test3 --stringTest=aaa homer marge bart -- one two > tmp.out 2>&1
|
||||
|
||||
if cmp -s tmp.out test14.out; then
|
||||
exit 0
|
||||
|
@ -1,10 +1,10 @@
|
||||
PARSE ERROR: Argument: -s (--stringTest)
|
||||
PARSE ERROR: Argument: (--stringTest)
|
||||
Couldn't find delimiter for this argument!
|
||||
|
||||
Brief USAGE:
|
||||
../examples/test3 [-f=<float>] ... [-i=<int>] ... -s=<string> [-B]
|
||||
[--] [-v] [-h] <string> <string> <fileNameString>
|
||||
...
|
||||
../examples/test3 [-f=<float>] ... [-i=<int>] ...
|
||||
--stringTest=<string> [-B] [--] [-v] [-h] <string>
|
||||
<string> <fileNameString> ...
|
||||
|
||||
For complete USAGE and HELP type:
|
||||
../examples/test3 --help
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# failure
|
||||
../examples/test3 -s bbb homer marge bart -- -hv two > tmp.out 2>&1
|
||||
../examples/test3 --stringTest bbb homer marge bart -- -hv two > tmp.out 2>&1
|
||||
|
||||
if cmp -s tmp.out test15.out; then
|
||||
exit 0
|
||||
|
@ -1,10 +1,10 @@
|
||||
PARSE ERROR: Argument: -s (--stringTest)
|
||||
PARSE ERROR: Argument: (--stringTest)
|
||||
Couldn't find delimiter for this argument!
|
||||
|
||||
Brief USAGE:
|
||||
../examples/test3 [-f=<float>] ... [-i=<int>] ... -s=<string> [-B]
|
||||
[--] [-v] [-h] <string> <string> <fileNameString>
|
||||
...
|
||||
../examples/test3 [-f=<float>] ... [-i=<int>] ...
|
||||
--stringTest=<string> [-B] [--] [-v] [-h] <string>
|
||||
<string> <fileNameString> ...
|
||||
|
||||
For complete USAGE and HELP type:
|
||||
../examples/test3 --help
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# failure
|
||||
../examples/test3 -s one homer -B -Bh > tmp.out 2>&1
|
||||
../examples/test3 --stringTest one homer -B -Bh > tmp.out 2>&1
|
||||
|
||||
if cmp -s tmp.out test16.out; then
|
||||
exit 0
|
||||
|
@ -2,9 +2,9 @@ PARSE ERROR:
|
||||
One or more required arguments missing!
|
||||
|
||||
Brief USAGE:
|
||||
../examples/test3 [-f=<float>] ... [-i=<int>] ... -s=<string> [-B]
|
||||
[--] [-v] [-h] <string> <string> <fileNameString>
|
||||
...
|
||||
../examples/test3 [-f=<float>] ... [-i=<int>] ...
|
||||
--stringTest=<string> [-B] [--] [-v] [-h] <string>
|
||||
<string> <fileNameString> ...
|
||||
|
||||
For complete USAGE and HELP type:
|
||||
../examples/test3 --help
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# failure
|
||||
../examples/test3 -s=one homer -B > tmp.out 2>&1
|
||||
../examples/test3 --stringTest=one homer -B > tmp.out 2>&1
|
||||
|
||||
if cmp -s tmp.out test17.out; then
|
||||
exit 0
|
||||
|
@ -2,9 +2,9 @@ PARSE ERROR: Argument: -i (--intTest)
|
||||
Couldn't read argument value from string '9a'
|
||||
|
||||
Brief USAGE:
|
||||
../examples/test3 [-f=<float>] ... [-i=<int>] ... -s=<string> [-B]
|
||||
[--] [-v] [-h] <string> <string> <fileNameString>
|
||||
...
|
||||
../examples/test3 [-f=<float>] ... [-i=<int>] ...
|
||||
--stringTest=<string> [-B] [--] [-v] [-h] <string>
|
||||
<string> <fileNameString> ...
|
||||
|
||||
For complete USAGE and HELP type:
|
||||
../examples/test3 --help
|
||||
|
@ -2,9 +2,9 @@ PARSE ERROR: Argument: -f (--floatTest)
|
||||
More than one valid value parsed from string '1.0.0'
|
||||
|
||||
Brief USAGE:
|
||||
../examples/test3 [-f=<float>] ... [-i=<int>] ... -s=<string> [-B]
|
||||
[--] [-v] [-h] <string> <string> <fileNameString>
|
||||
...
|
||||
../examples/test3 [-f=<float>] ... [-i=<int>] ...
|
||||
--stringTest=<string> [-B] [--] [-v] [-h] <string>
|
||||
<string> <fileNameString> ...
|
||||
|
||||
For complete USAGE and HELP type:
|
||||
../examples/test3 --help
|
||||
|
@ -1,9 +1,9 @@
|
||||
|
||||
USAGE:
|
||||
|
||||
../examples/test3 [-f=<float>] ... [-i=<int>] ... -s=<string> [-B]
|
||||
[--] [-v] [-h] <string> <string> <fileNameString>
|
||||
...
|
||||
../examples/test3 [-f=<float>] ... [-i=<int>] ...
|
||||
--stringTest=<string> [-B] [--] [-v] [-h] <string>
|
||||
<string> <fileNameString> ...
|
||||
|
||||
|
||||
Where:
|
||||
@ -14,7 +14,7 @@ Where:
|
||||
-i <int>, --intTest <int> (accepted multiple times)
|
||||
(value required) multi int test
|
||||
|
||||
-s <string>, --stringTest <string>
|
||||
--stringTest <string>
|
||||
(required) (value required) string test
|
||||
|
||||
-B, --existTestB
|
||||
|
6
tests/test55.out
Normal file
6
tests/test55.out
Normal file
@ -0,0 +1,6 @@
|
||||
[ ] 0 zero
|
||||
[ ] 1 one
|
||||
for string we got : asdf
|
||||
for ulabeled one we got : -
|
||||
for ulabeled two we got : asdf
|
||||
for bool B we got : 0
|
11
tests/test55.sh
Executable file
11
tests/test55.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
# success
|
||||
../examples/test3 --stringTest=asdf - asdf zero one > tmp.out 2>&1
|
||||
|
||||
if cmp -s tmp.out test55.out; then
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
9
tests/test56.out
Normal file
9
tests/test56.out
Normal file
@ -0,0 +1,9 @@
|
||||
0 one
|
||||
1 two
|
||||
for float we got : 3.7
|
||||
for int we got : 1
|
||||
for string we got : fdsa
|
||||
for ulabeled we got : -
|
||||
for bool A we got : 0
|
||||
for bool B we got : 0
|
||||
for bool C we got : 0
|
11
tests/test56.sh
Executable file
11
tests/test56.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
# success
|
||||
../examples/test2 -i 1 - -s fdsa one two > tmp.out 2>&1
|
||||
|
||||
if cmp -s tmp.out test56.out; then
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user