summaryrefslogtreecommitdiff
path: root/doc/help2man
diff options
context:
space:
mode:
Diffstat (limited to 'doc/help2man')
-rwxr-xr-xdoc/help2man32
1 files changed, 17 insertions, 15 deletions
diff --git a/doc/help2man b/doc/help2man
index dcc3c67b4..99665c59f 100755
--- a/doc/help2man
+++ b/doc/help2man
@@ -1,7 +1,9 @@
#!/usr/bin/perl -w
# Generate a short man page from --help and --version output.
-# Copyright (C) 1997-2022 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2009,
+# 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
# it under the terms of the GNU General Public License as published by
@@ -27,7 +29,7 @@ use Text::Tabs qw(expand);
use POSIX qw(strftime setlocale LC_ALL);
my $this_program = 'help2man';
-my $this_version = '1.48.4';
+my $this_version = '1.49.1';
sub _ { $_[0] }
sub configure_locale
@@ -52,7 +54,7 @@ my $version_info = enc_user sprintf _(<<'EOT'), $this_program, $this_version;
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.
@@ -176,13 +178,13 @@ while (@opt_include)
$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;
@@ -218,7 +220,7 @@ while (@opt_include)
# revision info.
unless ($key)
{
- # handle options
+ # Handle options.
if (/^-/)
{
local @ARGV = shellwords $_;
@@ -263,7 +265,7 @@ if (exists $ENV{SOURCE_DATE_EPOCH} and $ENV{SOURCE_DATE_EPOCH} =~ /^(\d+)$/)
# 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;
@@ -338,15 +340,15 @@ for ($replace{_('NAME')} || ($include{_('NAME')} ||= ''))
# 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') }
}
}
@@ -532,7 +534,7 @@ while (length)
{
$matched .= $& if %append_match;
$content = ".HP\n\x84$1\n";
- $indent = 80; # not continued
+ $indent = 80; # not continued
}
# Indented paragraph with tag.
@@ -667,7 +669,7 @@ while (my ($sect, $text) = each %replace)
}
# 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
@@ -698,8 +700,8 @@ for my $sect (@pre, (grep !$filter{$_}, @sections), @post)
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 $_;
}