Fix handling EXT_ARGV.

This commit is contained in:
Daniel Nichter
2012-01-23 10:53:41 -07:00
parent 0d348ce289
commit 034f76d77e
2 changed files with 39 additions and 31 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
TESTS=46
TESTS=49
TMPFILE="$TEST_TMPDIR/parse-opts-output"
TOOL="pt-stalk"
@@ -74,6 +74,16 @@ is "$OPT_VERSION" "" "--version (neg)"
parse_options "$T_LIB_DIR/samples/bash/po001.sh" -v
is "$OPT_VERSION" "yes" "Short form"
# ############################################################################
# Command line options plus externals args.
# ############################################################################
parse_options "$T_LIB_DIR/samples/bash/po001.sh" --no-noption -- --foo
is "$OPT_NOPTION" "" "Negated option (--)"
is "$ARGV" "" "ARGV (--)"
is "$EXT_ARGV" "--foo" "External ARGV (--)"
# ############################################################################
# An unknown option should produce an error.
# ############################################################################