diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-12-30 20:13:29 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-12-30 20:30:44 -0800 |
commit | b7e077d0225eac833ce2eb6fe9e1807f77d0f848 (patch) | |
tree | ad34593e9ff058ece07feabe1d6c8f9d37c3d827 /perl.c | |
parent | b3adf4c04b682aa1b048bc826d019a355ea7637d (diff) | |
download | perl-b7e077d0225eac833ce2eb6fe9e1807f77d0f848.tar.gz |
[perl #104288] Die with ‘Unrecognized switch’ on #! line
If a switch such as -x that cannot occur on the shebang line is used
there, perl dies with ‘Can’t emulate...’.
If an unrecognised switch is used on the command line, perl dies with
‘Unrecognized switch...’.
It just happens to use the former error message for unrecognized
switches on the shebang line, which can be confusing:
$ perl -e '#!perl -G'
Can't emulate -G on #! line at -e line 1.
This commit changes it to output the same message as command-line
switches for those that are unrecognised wherever they are used.
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -3354,8 +3354,12 @@ Perl_moreswitches(pTHX_ const char *s) case 'S': /* OS/2 needs -S on "extproc" line. */ break; #endif - default: + case 'e': case 'f': case 'x': case 'E': case 'S': case 'V': Perl_croak(aTHX_ "Can't emulate -%.1s on #! line",s); + default: + Perl_croak(aTHX_ + "Unrecognized switch: -%.1s (-h will show valid options)",s + ); } return NULL; } |