Restore ability to handle underdefined root (t/prefetch/incomplete.t)
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Admin / Usage.pm
index 291fd1e..6aabfd9 100644 (file)
@@ -1,13 +1,13 @@
 package     # hide from PAUSE
     DBIx::Class::Admin::Usage;
 
+use warnings;
+use strict;
 
 use base 'Getopt::Long::Descriptive::Usage';
 
 use base 'Class::Accessor::Grouped';
 
-use Class::C3;
-
 __PACKAGE__->mk_group_accessors('simple', 'synopsis', 'short_description');
 
 sub prog_name {
@@ -22,13 +22,8 @@ sub set_simple {
 }
 
 
-=head2 pod
-
-This returns the usage formated as a pod document
-
-=cut
-
 
+# This returns the usage formated as a pod document
 sub pod {
   my ($self) = @_;
   return join qq{\n}, $self->pod_leader_text, $self->pod_option_text, $self->pod_authorlic_text;
@@ -44,17 +39,13 @@ sub pod_leader_text {
 
 sub pod_authorlic_text {
 
-  return <<'EOA'
-=head1 AUTHORS
-
-See L<DBIx::Class/CONTRIBUTORS>
-
-=head1 LICENSE
-
-You may distribute this code under the same terms as Perl itself
-
-=cut
-EOA
+  return join ("\n\n",
+    '=head1 AUTHORS',
+    'See L<DBIx::Class/CONTRIBUTORS>',
+    '=head1 LICENSE',
+    'You may distribute this code under the same terms as Perl itself',
+    '=cut',
+  );
 }
 
 
@@ -69,6 +60,7 @@ sub pod_option_text {
   foreach my $opt (@options) {
     my $spec = $opt->{spec};
     my $desc = $opt->{desc};
+    next if ($desc eq 'hidden');
     if ($desc eq 'spacer') {
         $string .= "=back\n\n=head2 $spec\n\n=cut\n\n=over\n\n";
         next;
@@ -76,7 +68,7 @@ sub pod_option_text {
 
     $spec = Getopt::Long::Descriptive->_strip_assignment($spec);
     $string .= "=item " . join " or ", map { length > 1 ? "B<--$_>" : "B<-$_>" }
-                             split /\|/, $spec; 
+                             split /\|/, $spec;
     $string .= "\n\n$desc\n\n=cut\n\n";
 
   }