Index: gnu/tests/env/env-S.pl
===================================================================
@@ -216,15 +216,15 @@ my @Tests =
# Test Error Conditions
['err1', q[-S'"\\c"'], {EXIT=>125},
- {ERR=>"$prog: '\\c' must not appear in double-quoted -S string\n"}],
+ {ERR=>"$prog: '\\c' must not appear in double-quoted -S string at position 2\n"}],
['err2', q[-S'A=B\\'], {EXIT=>125},
- {ERR=>"$prog: invalid backslash at end of string in -S\n"}],
+ {ERR=>"$prog: invalid backslash at end of string in -S at position 4 in context Unquoted\n"}],
['err3', q[-S'"A=B\\"'], {EXIT=>125},
- {ERR=>"$prog: no terminating quote in -S string\n"}],
+ {ERR=>"$prog: no terminating quote in -S string at position 6 for quote '\"'\n"}],
['err4', q[-S"'A=B\\\\'"], {EXIT=>125},
- {ERR=>"$prog: no terminating quote in -S string\n"}],
+ {ERR=>"$prog: no terminating quote in -S string at position 6 for quote '''\n"}],
['err5', q[-S'A=B\\q'], {EXIT=>125},
- {ERR=>"$prog: invalid sequence '\\q' in -S\n"}],
+ {ERR=>"$prog: invalid sequence '\\q' in -S at position 4\n"}],
['err6', q[-S'A=$B'], {EXIT=>125},
{ERR=>"$prog: only \${VARNAME} expansion is supported, error at: \$B\n"}],
['err7', q[-S'A=${B'], {EXIT=>125},
@@ -239,13 +239,17 @@ my @Tests =
# Test incorrect shebang usage (extraneous whitespace).
['err_sp2', q['-v -S cat -n'], {EXIT=>125},
- {ERR=>"env: invalid option -- ' '\n" .
- "env: use -[v]S to pass options in shebang lines\n" .
- "Try 'env --help' for more information.\n"}],
+ {ERR=>"error: unexpected argument '- ' found\n\n" .
+ " tip: to pass '- ' as a value, use '-- - '\n\n" .
+ "Usage: $prog [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]\n\n" .
+ "For more information, try '--help'.\n" .
+ "$prog: use -[v]S to pass options in shebang lines\n"}],
['err_sp3', q['-v -S cat -n'], {EXIT=>125}, # embedded tab after -v
- {ERR=>"env: invalid option -- '\t'\n" .
- "env: use -[v]S to pass options in shebang lines\n" .
- "Try 'env --help' for more information.\n"}],
+ {ERR=>"error: unexpected argument '-\t' found\n\n" .
+ " tip: to pass '-\t' as a value, use '-- -\t'\n\n" .
+ "Usage: $prog [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]\n\n" .
+ "For more information, try '--help'.\n" .
+ "$prog: use -[v]S to pass options in shebang lines\n"}],
# Also diagnose incorrect shebang usage when failing to exec.
# This typically happens with: