# Generate a short man page from --help and --version output.
# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2009,
-# 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2020, 2021 Free Software
+# 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2020, 2021, 2022 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
use POSIX qw(strftime setlocale LC_ALL);
my $this_program = 'help2man';
-my $this_version = '1.48.5';
+my $this_version = '1.49.3';
sub _ { $_[0] }
sub configure_locale
GNU %s %s
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2009,
-2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2020, 2021 Free Software
+2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2020, 2021, 2022 Free Software
Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$key =~ s/^\s+//;
$key =~ s/\s+$//;
$hash = \%include;
- # Handle explicit [<section], [=section] and [>section]
+ # Handle explicit [<section], [=section] and [>section].
if ($key =~ s/^([<>=])\s*//)
{
if ($1 eq '>') { $hash = \%append; }
elsif ($1 eq '=') { $hash = \%replace; }
}
- # NAME/SYNOPSIS replace by default
+ # NAME/SYNOPSIS replace by default.
elsif ($key eq _('NAME') or $key eq _('SYNOPSIS'))
{
$hash = \%replace;
# revision info.
unless ($key)
{
- # handle options
+ # Handle options.
if (/^-/)
{
local @ARGV = shellwords $_;
# the English version expands to the month as a word and the full year. It
# is used on the footer of the generated manual pages. If in doubt, you may
# just use %x as the value (which should be the full locale-specific date).
-my $date = enc strftime _("%B %Y"), localtime $epoch_secs;
+my $date = strftime _("%B %Y"), localtime $epoch_secs;
my $program = program_basename $ARGV[0];
my $package = $program;
my $version;
# Man pages traditionally have the page title in caps.
my $PROGRAM = uc $program;
-# Set default page head/footers
+# Set default page head/footers.
$source ||= "$package $version";
unless ($manual)
{
for ($section)
{
- if (/^(1[Mm]|8)/) { $manual = enc _('System Administration Utilities') }
- elsif (/^6/) { $manual = enc _('Games') }
- else { $manual = enc _('User Commands') }
+ if (/^(1[Mm]|8)/) { $manual = _('System Administration Utilities') }
+ elsif (/^6/) { $manual = _('Games') }
+ else { $manual = _('User Commands') }
}
}
{
$matched .= $& if %append_match;
$content = ".HP\n\x84$1\n";
- $indent = 80; # not continued
+ $indent = 80; # not continued
}
# Indented paragraph with tag.
}
# Output header.
-print <<EOT;
+print enc <<EOT;
.\\" DO NOT MODIFY THIS FILE! It was generated by $this_program $this_version.
.TH $PROGRAM "$section" "$date" "$source" "$manual"
EOT
s/\x82/\\e/g;
s/\x83/\\-/g;
- # Convert some latin1 chars to troff equivalents
- s/\xa0/\\ /g; # non-breaking space
+ # Convert some latin1 chars to troff equivalents.
+ s/\xa0/\\ /g; # non-breaking space
print enc $_;
}