mirror of
git://git.sv.gnu.org/coreutils
synced 2026-05-06 07:06:38 -04:00
maint: sync help2man to latest version
* man/help2man: sync changes from version 1.48.5 through 1.49.3. This doesn't materially change the generated man pages.
This commit is contained in:
+15
-15
@@ -2,7 +2,7 @@
|
||||
|
||||
# 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
|
||||
@@ -29,7 +29,7 @@ use Text::Tabs qw(expand);
|
||||
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
|
||||
@@ -54,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.
|
||||
@@ -180,13 +180,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;
|
||||
@@ -222,7 +222,7 @@ while (@opt_include)
|
||||
# revision info.
|
||||
unless ($key)
|
||||
{
|
||||
# handle options
|
||||
# Handle options.
|
||||
if (/^-/)
|
||||
{
|
||||
local @ARGV = shellwords $_;
|
||||
@@ -267,7 +267,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;
|
||||
@@ -342,15 +342,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') }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -545,7 +545,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.
|
||||
@@ -691,7 +691,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
|
||||
@@ -730,8 +730,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 $_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user