.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Bigtop::ScriptHelp 3" .TH Bigtop::ScriptHelp 3 "2008-01-18" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" Bigtop::ScriptHelp \- A helper modules for command line utilities .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& #!/usr/bin/perl \& use Bigtop::ScriptHelp; .Ve .PP .Vb 3 \& my $default = Bigtop::ScriptHelp->get_minimal_default(); \& my $tree = Bigtop::Parser->parse_string( $default ); \& # ... .Ve .PP .Vb 1 \& my $style = 'SomeStyle'; # must live in Bigtop::ScriptHelp::Style:: .Ve .PP .Vb 4 \& my $better_default = Bigtop::ScriptHelp->get_big_default( \& $style, $name, $art \& ); \& my $better_tree = Bigtop::Parser->parse_string( $better_default ); .Ve .PP .Vb 1 \& Bigtop::ScriptHelp->augment_tree( $style, $bigtop_tree, $art ); .Ve .PP .Vb 1 \& my $new_field_label = Bigtop::ScriptHelp->default_label( $name ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module is used by the bigtop and tentmaker scripts. It provides convenience functions for them. .SH "Styles" .IX Header "Styles" Whenever a user is building or augmenting a bigtop file, they can specify new tables and their relationships via a script help style of their choice. All the styles are modules in the Bigtop::ScriptHelp::Style:: namespace. See \f(CW\*(C`Bigtop::ScriptHelp::Style\*(C'\fR for general information about styles and individual modules under its namespace for how each style works. That said, here is a list of the styles available when this was written. .Sh "Kickstart" .IX Subsection "Kickstart" This is the default style. .PP It allows short text descriptions of database relationships. For example: .PP .Vb 1 \& bigtop -n App 'contact<-birth_day' .Ve .PP But recent versions allow you to specify column names, their types, whether they are optional, and to give them literal default values. See \&\f(CW\*(C`Bigtop::ScriptHelp::Style::Kickstart\*(C'\fR for details. This is my favorite style (so it's no surprise that it is the default). .Sh "Pg8Live" .IX Subsection "Pg8Live" This style must be requested: .PP .Vb 1 \& bigtop -n App -s Pg8Live dsninfo username password .Ve .PP It will connect to the database described by the dsninfo with the supplied username and password and create a bigtop file from it. This will create a full AutoCRUD app for the database. The bigtop file will have all the tables, their columns including types and defaults. It will also know about all primary and foreign keys in the original database. Depending on how exotic the input database is, it will also know to autoincrement the primary key. .PP Writing your own style is easy. See \f(CW\*(C`Bigtop::ScriptHelp::Style\*(C'\fR for the requirements and the two existing styles for examples. .SH "METHODS" .IX Header "METHODS" All methods are class methods. .IP "get_minimal_default" 4 .IX Item "get_minimal_default" Params: app_name (optional, defaults to Sample) .Sp Returns: a little default bigtop string suitable for initial building. It has everything you need for your app except tables and controllers. .IP "get_big_default" 4 .IX Item "get_big_default" Params: .Sp .Vb 3 \& script help style \& app name \& a list of data for the style .Ve .Sp Returns: a bigtop file suitable for immediately creating an app and starting it. .IP "augment_tree" 4 .IX Item "augment_tree" Params: .Sp .Vb 3 \& script help style \& a Bigtop::Parser syntax tree (what you got from a parse_* method) \& a string of data for the style (join all elements with spaces) .Ve .Sp Returns: nothing, but the tree you passed will be updated. .IP "default_label" 4 .IX Item "default_label" Params: a new name .Sp Returns: a default label for that name .Sp Example of conversion: if name is birth_date, the label becomes 'Birth Date'. .IP "default_controller" 4 .IX Item "default_controller" Params: a new table name .Sp Returns: a default label for that table's controller .Sp Example of conversion: if table name is birth_date, the controller becomes 'BirthDate'. .SH "FUNCTIONS" .IX Header "FUNCTIONS" The following functions are meant for internal use, but you might like them too. Don't call them through the class, call them as functions. .IP "valid_ident" 4 .IX Item "valid_ident" Exported by default. .Sp Params: a proposed ident .Sp Returns: true if the ident looks good, false otherwise. Note that the regex is not perfect. For instance, it will allow leading numbers. Further it absolutely will not notice if a table or controller name is reserved. .SH "AUTHOR" .IX Header "AUTHOR" Phil Crow, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2006\-7, Phil Crow .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.