# Note that the below is very, very specific to Pod::Text.
sub _handle_element_end {
my ($self, $element) = @_;
- if ($element eq 'head1' && $self->{USAGE_OPTIONS}->{-verbose} < 2) {
+ if ($element eq 'head1') {
$$self{USAGE_HEAD1} = $$self{PENDING}[-1][1];
- $$self{PENDING}[-1][1] =~ s/^\s*SYNOPSIS\s*$/USAGE/;
+ if ($self->{USAGE_OPTIONS}->{-verbose} < 2) {
+ $$self{PENDING}[-1][1] =~ s/^\s*SYNOPSIS\s*$/USAGE/;
+ }
} elsif ($element eq 'head2') {
$$self{USAGE_HEAD2} = $$self{PENDING}[-1][1];
}
is ($exit, 2, "Exit status pod2usage ()");
ok (compare ($text, <<'EOT'), "Output test pod2usage ()");
#Usage:
-# frobnicate [ -r | --recursive ] [ -f | --force ] [ -n number ] file ...
+# frobnicate [ -r | --recursive ] [ -f | --force ] file ...
#
EOT
ok (compare ($text, <<'EOT'), "Output test pod2usage (-message => '...', -verbose => 1)");
#You naughty person, what did you say?
# Usage:
-# frobnicate [ -r | --recursive ] [ -f | --force ] [ -n number ] file ...
+# frobnicate [ -r | --recursive ] [ -f | --force ] file ...
#
# Options:
# -r | --recursive
# frobnicate - do what I mean
#
# SYNOPSIS
-# frobnicate [ -r | --recursive ] [ -f | --force ] [ -n number ] file ...
+# frobnicate [ -r | --recursive ] [ -f | --force ] file ...
#
# DESCRIPTION
# frobnicate does foo and bar and what not.
is ($exit, 0, "Exit status pod2usage (0)");
ok (compare ($text, <<'EOT'), "Output test pod2usage (0)");
#Usage:
-# frobnicate [ -r | --recursive ] [ -f | --force ] [ -n number ] file ...
+# frobnicate [ -r | --recursive ] [ -f | --force ] file ...
#
# Options:
# -r | --recursive
is ($exit, 42, "Exit status pod2usage (42)");
ok (compare ($text, <<'EOT'), "Output test pod2usage (42)");
#Usage:
-# frobnicate [ -r | --recursive ] [ -f | --force ] [ -n number ] file ...
+# frobnicate [ -r | --recursive ] [ -f | --force ] file ...
#
EOT
is ($exit, 0, "Exit status pod2usage (-verbose => 0, -exit => 'NOEXIT')");
ok (compare ($text, <<'EOT'), "Output test pod2usage (-verbose => 0, -exit => 'NOEXIT')");
#Usage:
-# frobnicate [ -r | --recursive ] [ -f | --force ] [ -n number ] file ...
+# frobnicate [ -r | --recursive ] [ -f | --force ] file ...
#
# --NORMAL-RETURN--
EOT
=head1 SYNOPSIS
B<frobnicate> S<[ B<-r> | B<--recursive> ]> S<[ B<-f> | B<--force> ]>
- S<[ B<-n> I<number> ]> I<file> ...
+ file ...
=head1 DESCRIPTION
Just do it!
-=item B<-n> I<number>
+=item B<-n> number
Specify number of frobs, default is 42.