| 1 | #!/usr/bin/env perl | ||
| 2 | ###################################################################### | ||
| 3 | # | ||
| 4 | # batsh.pl - command-line launcher for BATsh | ||
| 5 | # | ||
| 6 | # Copyright (c) 2026 INABA Hitoshi <ina.cpan@gmail.com> | ||
| 7 | # | ||
| 8 | # Installed via EXE_FILES so that "batsh.pl script.batsh" works after | ||
| 9 | # "make install" (ExtUtils::MakeMaker creates a .bat wrapper on Win32). | ||
| 10 | # The process exit code is the script's exit code. | ||
| 11 | # | ||
| 12 | # COMPATIBILITY: Perl 5.005_03 and later | ||
| 13 | # | ||
| 14 | ###################################################################### | ||
| 15 | |||
| 16 | use strict; | ||
| 17 | BEGIN { if ($] < 5.006 && !defined(&warnings::import)) { | ||
| 18 | $INC{'warnings.pm'} = 'stub'; eval 'package warnings; sub import {}' } } | ||
| 19 | use warnings; local $^W = 1; | ||
| 20 | BEGIN { pop @INC if $INC[-1] eq '.' } | ||
| 21 | |||
| 22 | # Prefer the sibling lib/ when run from an unpacked distribution | ||
| 23 | # (perl bin/batsh.pl ...); an installed BATsh is found via @INC as usual. | ||
| 24 | use FindBin (); | ||
| 25 | use lib "$FindBin::Bin/../lib"; | ||
| 26 | |||
| 27 | use BATsh; | ||
| 28 | |||
| 29 | exit(BATsh->main(@ARGV)); | ||
| 30 | |||
| 31 | __END__ |