From 773e3cd88a99e494dda68312eadb5310da2414eb Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Sat, 2 Aug 2025 15:49:04 -0500 Subject: [PATCH] Do not completely lowecase the first word in a heading --- lib/Pod/Usage.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Pod/Usage.pm b/lib/Pod/Usage.pm index a11d1ec..f3e28c9 100644 --- a/lib/Pod/Usage.pm +++ b/lib/Pod/Usage.pm @@ -334,6 +334,8 @@ sub _handle_element_end { # a colon to end all headings. if($self->{USAGE_OPTIONS}->{-verbose} < 2) { local $_ = $$self{PENDING}[-1][1]; + ## Do not completely lowercase the first word + s{^([A-Z])([A-Z]+)}{$1 . lc($2)}e; s{([A-Z])([A-Z]+)}{((length($2) > 2) ? $1 : lc($1)) . lc($2)}ge; s/\s*$/:/ unless (/:\s*$/); $_ .= "\n"; @@ -374,6 +376,8 @@ sub preprocess_paragraph { ## Change the title of the SYNOPSIS section to USAGE s/^=head1\s+SYNOPSIS\s*$/=head1 USAGE/; ## Try to do some lowercasing instead of all-caps in headings + ## Do not completely lowercase the first word + s{^([A-Z])([A-Z]+)}{$1 . lc($2)}e; s{([A-Z])([A-Z]+)}{((length($2) > 2) ? $1 : lc($1)) . lc($2)}ge; ## Use a colon to end all headings s/\s*$/:/ unless (/:\s*$/);