NAME

bigtop - the parser/generater for the bigtop langauge

SYNOPSIS

bigtop [options] file.bigtop all

Or, for brand new apps:

bigtop --new AppName [ table_name... ]

DESCRIPTION

To learn more about bigtop, consult Bigtop::Docs::TOC. It has a list of all the documentation along with suggestions of where to start.

This script usually takes a bigtop input file and a list of things to build. The things you can build have the same names as the blocks in the config section of your bigtop file. You may also choose all which will build all of those things in the order they appear in the config section.

If you are starting a new app from scratch, you can get a jump start with the --new flag (or -n if you prefer):

bigtop --new AppName table1 table2

NON-HELP OPTIONS

--create (or -c)

Use this if you already have a bigtop source file. Perhaps someone gave you one, you copied one from the examples directory of the bigtop distribution, or you built one with tentmaker.

This will make an h2xs style path under the current directory for the app described in your bigtop file. It will even copy that bigtop file into the docs directory while it builds whatever you ask for.

Without this option, if the current directory looks like a bad place to build, a fatal error will result and you will have to use this option. A bad place to build is a place where building seems not to have happened before. If any of these are missing, then the directory is bad:

Build.PL
Changes
t/
lib/

When create is in effect, the following bigtop config options affect the location of the initial build:

base_dir - the directory under which all building will happen
           Defaults to the current directory.

app_dir  - the subdirectory of base_dir where Build.PL and friends
           will live
           Defaults to the h2xs style directory name based on your app's
           name.  If your app section starts:
               app App::Name::SubName
           then the default app_dir is:
               App-Name-SubName

When create is not in effect, these config parameters are ignored WITH a warning.

--new (or -n) App::Name [table_1...]

Use this option to create a working application from scratch. It will use this bigtop specification:

config {
    Init Std {}
}
app App::Name {
}

If you supply optional table names, additional items will be added to the bigtop file, some of which will be repeated for each model you request. In particular, more backends will be used and each model will have a table, and a controller. So the bigtop spec will look more like this (don't feel like you have to understand this just yet):

config {
    engine          CGI;
    template_engine TT;

    Init            Std             {}
    SQL             SQLite          {}
    SQL             Postgres        {}
    SQL             MySQL           {}
    CGI             Gantry          { with_server 1; gen_root 1; }
    Contrl          Gantry          { dbix 1; }
    Model           GantryDBIxClass {}
    SiteLook        GantryDefault   {}
}
app App::Name {
    config {
        dbconn `dbi:SQLite:dbname=app.db` => no_accessor;
        dbuser `` => no_accessor;
        template_wrapper `genwrapper.tt` => no_accessor;
    }
    table table_1 {
        field id { is int4, primary_key, auto; }
        field ident {
            is varchar; label Ident; html_form_type text;
        }
        field descr {
            is varchar; label Descripion; html_form_type text;
        }
        field created { is date; }
        field modified { is date; }
    }
    controller Table_1 is AutoCRUD {
        controls_table table_1;
        rel_location table_1;
        text_description table_1;
        page_link_label Table_1;
        method do_main is main_listing {
            cols created, modified;
            header_options Add;
            row_options Edit, Delete;
            title Table_1;
        }
        method form is AutoCRUD_form {
            all_fields_but id, created, modified;
        }
    }
}

In either case, when bigtop finishes, there will be an App-Name subdirectory of the current directory. In it will be all the usual pieces describing an app. The bigtop file will be in the docs directory.

If you have a working sqlite in your path -- and you specified tables -- -n will also make an sqlite database called app.db in the build directory. As it will tell you, you can change to that directory and start the app immediately.

If you don't have sqlite, a message will explain what to do to start the app. Mostly this boils down to changing into the new build directory, creating a database called app.db, and running app.server with the proper flags for your server.

--keep_inline (or -k)

Normally, this script removes all traces of the _Inline directory it used while building your app. Use this option if you want to save a microscopic amount of time on each regeneration or if you have an incurable curiosity.

Note that the directory will only be removed if it is really _Inline in the current directory. If you have a .Inline directory under home directory etc., the script will not affect it.

HELP OPTIONS

In addition to the flags that do useful things, there are help flags:

--help or -h

Prints a multi-line usage message showing all the options.

--pg_help and --mysql_help

Prints advice on how to start your app.server with a Postgres or MySQL database instead of sqlite. This includes instructions on creating and building the database, as well as flags app.server needs in order to reach that database.

AUTHOR

Phil Crow <philcrow2000@yahoo.com>

COPYRIGHT and LICENSE

Copyright (C) 2005-6 by Phil Crow

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.