[Bast-commits] r8796 - in DBIx-Class/0.08/trunk: lib
lib/DBIx/Class/Admin script
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Mon Feb 22 20:24:28 GMT 2010
Author: ribasushi
Date: 2010-02-22 20:24:28 +0000 (Mon, 22 Feb 2010)
New Revision: 8796
Modified:
DBIx-Class/0.08/trunk/lib/
DBIx-Class/0.08/trunk/lib/DBIx/Class/Admin/Usage.pm
DBIx-Class/0.08/trunk/script/dbicadmin
Log:
Add a hidden option to dbicadmin to self-inject autogenerated POD
Property changes on: DBIx-Class/0.08/trunk/lib
___________________________________________________________________
Deleted: svn:ignore
- dbicadmin.pod
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Admin/Usage.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Admin/Usage.pm 2010-02-22 19:16:07 UTC (rev 8795)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Admin/Usage.pm 2010-02-22 20:24:28 UTC (rev 8796)
@@ -52,6 +52,8 @@
=head1 LICENSE
You may distribute this code under the same terms as Perl itself
+
+=cut
EOA
}
Modified: DBIx-Class/0.08/trunk/script/dbicadmin
===================================================================
--- DBIx-Class/0.08/trunk/script/dbicadmin 2010-02-22 19:16:07 UTC (rev 8795)
+++ DBIx-Class/0.08/trunk/script/dbicadmin 2010-02-22 20:24:28 UTC (rev 8796)
@@ -43,8 +43,8 @@
['update|u' => 'Update data in the schema', ],
['delete|D' => 'Delete data from the schema',],
['op:s' => 'compatiblity option all of the above can be suppied as --op=<action>'],
- ['help|h' => 'display this help', { implies => { schema_class => 'main' } } ],
- ['pod' => 'Output this usage as pod', { implies => { schema_class => 'main' } } ],
+ ['help|h' => 'display this help', { implies => { schema_class => '__dummy__' } } ],
+ ['selfinject-pod' => 'hidden', { implies => { schema_class => '__dummy__' } } ],
], required=> 1 }],
['Arguments'],
['schema-class|schema|C:s' => 'The class of the schema to load', { required => 1 } ],
@@ -68,11 +68,19 @@
die "please only use one of --config or --connect-info\n" if ($opts->{config} and $opts->{connect_info});
-if($opts->{pod}) {
+if($opts->{selfinject_pod}) {
$usage->synopsis($synopsis_text);
$usage->short_description($short_description);
- print $usage->pod();
- exit 0;
+ exec (
+ $^X,
+ qw/-p -0777 -i -e/,
+ (
+ 's/^# auto_pod_begin.*^# auto_pod_end/'
+ . quotemeta($usage->pod)
+ . '/ms'
+ ),
+ __FILE__
+ );
}
if($opts->{help}) {
@@ -112,28 +120,12 @@
}
-#__END__
+__END__
+
+# auto_pod_begin
#
-#=begin pod_begin
+# This will be replaced by the actual pod when selfinject-pod is invoked
#
-#BEGIN MARKER FOR DYNAMIC POD
-#
-#=end pod_begin
-#
-#=begin pod_end
-#
-#END MARKER FOR DYNAMIC POD
-#
-#=end pod_end
-#
-#=head1 AUTHOR
-#
-#See L<DBIx::Class/CONTRIBUTORS>.
-#
-#=head1 LICENSE
-#
-#You may distribute this code under the same terms as Perl itself
-#
-#=cut
+# auto_pod_end
# vim: et ft=perl
More information about the Bast-commits
mailing list