From: Jim Meyering Date: Wed, 24 Mar 1999 13:48:22 +0000 (+0000) Subject: import 1.010 X-Git-Tag: FILEUTILS-4_0e~104 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b80d92d60a3fcd94c97f3b039e848b9af4b57ee;p=thirdparty%2Fcoreutils.git import 1.010 --- diff --git a/man/help2man b/man/help2man index 895069e895..c4ef0c8159 100755 --- a/man/help2man +++ b/man/help2man @@ -1,7 +1,7 @@ -#!/usr/bin/perl -w +#!/sw/tools/bin/perl -w # Generate a short man page from --help and --version output. -# Copyright © 1997, 98 Free Software Foundation, Inc. +# Copyright © 1997, 98, 99 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 @@ -25,11 +25,11 @@ use Getopt::Long; use POSIX qw(strftime setlocale LC_TIME); my $this_program = 'help2man'; -my $this_version = '1.007'; +my $this_version = '1.010'; my $version_info = < 0 and /^ {$ind}\S/) + { + s/^\s+//; + print "$_\n" if $_; + } + else + { + # use the words(s) before two or more spaces for the + # tag + s/^(\s+)//; + $ind = length $1; + + if (s/(\s\s+)/\n/) + { + $ind += (length $1) + index $_, "\n"; + } + else + { + $ind = 0; + } + + print ".TP\n$_\n" if $_; + } + } + # Anything else. + else + { + print ".PP\n" unless $ind < 0; + print "$_\n"; + $ind = -1; } - } - # Anything else. - else - { - print ".PP\n$_\n"; } }