#!/usr/bin/perl

use strict;
use warnings FATAL => 'all';

# Die if the exec below somehow re-invoked this script.
die "help2man-wrapper: error: recursively invoked\n" .
    "help2man-wrapper: note: this script should not be in \$PATH\n"
    if defined $ENV{SYSTEM_HELP2MAN_WRAPPER};
$ENV{SYSTEM_HELP2MAN_WRAPPER} = 't';

# This form of exec ensures that under no circumstances will Perl
# invoke a shell.
exec { 'help2man' } 'help2man', @ARGV
    or die "couldn't exec system help2man: $!\n";
