# 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 Free Software Foundation, Inc.
+# 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2020 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
use POSIX qw(strftime setlocale LC_ALL);
my $this_program = 'help2man';
-my $this_version = '1.47.3';
+my $this_version = '1.47.16';
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 Free Software Foundation, Inc.
+2011, 2012, 2013, 2014, 2015, 2016, 2017, 2020 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.
$version_text ||= get_option_value $ARGV[0], $version_option;
# By default the generated manual pages will include the current date. This may
-# however be overriden by setting the environment variable $SOURCE_DATE_EPOCH
-# to an integer value of the seconds since the UNIX epoch. This is primarily
+# however be overriden by setting the environment variable $SOURCE_DATE_EPOCH to
+# an integer value of the seconds since the UNIX epoch. This is primarily
# intended to support reproducible builds (wiki.debian.org/ReproducibleBuilds)
# and will additionally ensure that the output date string is UTC.
my $epoch_secs = time;
# <version>
# <program> <version>
# {GNU,Free} <program> <version>
-# <program> ({GNU,Free} <package>) <version>
-# <program> - {GNU,Free} <package> <version>
+# <program> ({GNU,Free,} <package>) <version>
+# <program> - {GNU,Free,} <package> <version>
+# <program> - {GNU,Free,} <package> - <version>
#
# and separated from any copyright/author details by a blank line.
($_, $version_text) = ((split /\n+/, $version_text, 2), '');
-if (/^(\S+) +\(((?:GNU|Free) +[^)]+)\) +(.*)/ or
- /^(\S+) +- *((?:GNU|Free) +\S+) +(.*)/)
+if (/^(\S+) +\(((?:(?:GNU|Free) +)?[^)]+)\) +(\S.*)$/ or
+ /^(\S+) +- +((?:(?:GNU|Free) +)?\S.*) +- +(\S.*)$/ or
+ /^(\S+) +- +((?:(?:GNU|Free) +)?\S+) +(\S.*)$/)
{
$program = program_basename $1;
$package = $2;
$version = $3;
}
-elsif (/^((?:GNU|Free) +)?(\S+) +(.*)/)
+elsif (/^((?:GNU|Free) +)?(\S+) +(\S.*)$/)
{
$program = program_basename $2;
$package = $1 ? "$1$program" : $program;
my $PROGRAM = uc $program;
# Set default page head/footers
-$source ||= "$program $version";
+$source ||= "$package $version";
unless ($manual)
{
for ($section)