Add a new Porting/podtidy to reformat pod using Pod::Tidy
authorLeon Brocard <acme@astray.com>
Tue, 23 Dec 2008 16:50:43 +0000 (16:50 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 25 Feb 2009 23:47:16 +0000 (23:47 +0000)
(cherry picked from commit 80029904763df471b761bf9ea848da86d4196c18)

MANIFEST
Porting/podtidy [new file with mode: 0644]

index 88f4611..e81381e 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -3519,6 +3519,7 @@ Porting/p4d2p             Generate patch from p4 diff
 Porting/p4genpatch     Generate patch from p4 change in repository (obsoletes p4desc)
 Porting/patching.pod   How to report changes made to Perl
 Porting/patchls                Flexible patch file listing utility
+Porting/podtidy                Reformat pod using Pod::Tidy
 Porting/pumpkin.pod    Guidelines and hints for Perl maintainers
 Porting/README.y2038   Perl notes for the 2038 fix
 Porting/regcharclass.pl        Generate regcharclass.h from inline data
diff --git a/Porting/podtidy b/Porting/podtidy
new file mode 100644 (file)
index 0000000..a15b378
--- /dev/null
@@ -0,0 +1,18 @@
+#!perl
+use strict;
+use warnings;
+use Pod::Tidy;
+
+# Reformat pod using Pod::Tidy
+
+# 72 is what fmt defaults to
+$Text::Wrap::columns = 72;
+
+my $filename = shift || die "Usage podtidy [filename]";
+
+Pod::Tidy::tidy_files(
+    files    => [$filename],
+    verbose  => 1,
+    inplace  => 1,
+    nobackup => 1,
+);