Use "yes" for true, "" for false. Use $PO_DIR instead of $TMP_DIR/po. Add and test Baron's code for 'Options and values after processing arguments'. Make --help exit 0 unless there were errors.

This commit is contained in:
Daniel Nichter
2012-01-24 12:49:18 -07:00
parent 42a8e39635
commit c2fd3f54c2
5 changed files with 51 additions and 27 deletions

View File

@@ -5,6 +5,7 @@ TESTS=19
TMPFILE="$TEST_TMPDIR/parse-opts-output"
TMPDIR="$TEST_TMPDIR"
PATH="$PATH:$PERCONA_TOOLKIT_SANDBOX/bin"
TOOL="pt-stalk"
mkdir "$TMPDIR/collect" 2>/dev/null

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
TESTS=63
TESTS=64
TMPFILE="$TEST_TMPDIR/parse-opts-output"
TOOL="pt-stalk"
@@ -105,6 +105,10 @@ cmd_ok \
"grep -q \"For more information, 'man pt-stalk' or 'perldoc\" $TMPFILE" \
"--help"
cmd_ok \
"grep -q '\-\-string-opt[ ]*(No value)' $TMPFILE" \
"Options and values after processing arguments"
# Don't interpolate.
parse_options "$T_LIB_DIR/samples/bash/po003.sh" --help
usage_or_errors "$T_LIB_DIR/samples/bash/po003.sh" >$TMPFILE 2>&1