src/argp/testsuite/ex1-test
raw| 1 | #! /bin/sh |
| 2 | |
| 3 | # Success with no args |
| 4 | ./ex1 || exit 1 |
| 5 | |
| 6 | # Fail with args |
| 7 | if ./ex1 foo 2>/dev/null ; then exit 1 ; fi |
| 8 | |
| 9 | # Respond to --help |
| 10 | ./ex1 --help >/dev/null || exit 1 |
| 11 | |
| 12 | # Not using ARGP_LONG_ONLY |
| 13 | if ./ex1 -help 2>/dev/null ; then exit 1 ; fi |
| 14 | |
| 15 | (./ex1 --help | grep Usage: >/dev/null ) || exit 1 |
| 16 | |
| 17 | exit 0 |
| 18 |