eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
& eval 'exec perl -S $0 $argv:q'
if 0;
# THE PRECEEDING STUFF EXECS perl via $PATH
# -*-Fundamental-*-
# $Id: //depot/clients/atg/cvs2p4/main/extra/dbdump#1 $
#
# Richard Geiger
#
require 5.000;
use Carp; # ...or flounder. (This will fail unless 'perl' is a perl5!)
$| = 1;
($Myname = $0) =~ s%^.*/%%;
sub usage
{
print <<_EOF_;
Usage: $Myname [ -d dbname -h ] conversiondir
-d dbname the base name of a db file (.dir/.pag files) (def. revmap)
-h print this message
_EOF_
exit $_[0];
}
# option switch variables get defaults here...
$DB = "revmap";
$help = 0;
use Getopt::Long;
GetOptions(
"db=s" => \$DB,
"help" => \$help,
) || usage(1);
$help && usage(0);
$Convdir = shift || usage(1);
chdir $Convdir || die "$Myname: can't chdir \"$Convdir\": $!";
$Convdir = `/bin/pwd`; chop $Convdir;
chdir $Here || die "$Myname: can't chdir \"$Here\": $!";
$Revmap = "$Convdir/$DB";
if (! dbmopen(REVMAP, $Revmap, 0444))
{ print "$Myname: can't dbmopen \"$Revmap\": $!\n"; exit 1; }
while (($key,$val) = each %REVMAP)
{ print "$key $val\n"; }
dbmclose REVMAP;