|
NAMEBigtop::ScriptHelp - A helper modules for command line utilitiesSYNOPSIS#!/usr/bin/perl use Bigtop::ScriptHelp; my $default = Bigtop::ScriptHelp->get_minimal_default(); my $tree = Bigtop::Parser->parse_string( $default ); # ... my $style = 'SomeStyle'; # must live in Bigtop::ScriptHelp::Style:: my $better_default = Bigtop::ScriptHelp->get_big_default( $style, $name, $art ); my $better_tree = Bigtop::Parser->parse_string( $better_default ); Bigtop::ScriptHelp->augment_tree( $style, $bigtop_tree, $art ); my $new_field_label = Bigtop::ScriptHelp->default_label( $name ); DESCRIPTIONThis module is used by the bigtop and tentmaker scripts. It provides convenience functions for them.StylesWhenever 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 "Bigtop::ScriptHelp::Style" 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.KickstartThis is the default style.It allows short text descriptions of database relationships. For example: bigtop -n App 'contact<-birth_day' But recent versions allow you to specify column names, their types, whether they are optional, and to give them literal default values. See "Bigtop::ScriptHelp::Style::Kickstart" for details. This is my favorite style (so it's no surprise that it is the default). Pg8LiveThis style must be requested:bigtop -n App -s Pg8Live dsninfo username password 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. Writing your own style is easy. See "Bigtop::ScriptHelp::Style" for the requirements and the two existing styles for examples. METHODSAll methods are class methods.
FUNCTIONSThe following functions are meant for internal use, but you might like them too. Don't call them through the class, call them as functions.
AUTHORPhil Crow, <crow.phil@gmail.com>COPYRIGHT AND LICENSECopyright (C) 2006-7, Phil CrowThis 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.
Visit the GSP FreeBSD Man Page Interface. |