| 1 | #!/usr/bin/env perl | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use DBIx::Changeset::App; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | my $cmd = DBIx::Changeset::App->new(); | |||||||||
| 9 | |||||||||||
| 10 | 1 | my @config_files = ('/etc/dbix_changeset.yml', '/usr/local/etc/dbix_changeset.yml', $ENV{HOME}.'/.dbix_changeset.yml'); | |||||||||
| 11 | |||||||||||
| 12 | 1 | ▶ | if ( $ENV{DBIX_CHANGESET_CONFIG} ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 1 | @config_files = split(/:/xm,$ENV{DBIX_CHANGESET_CONFIG}); | |||||||||
| 14 | } | ||||||||||
| 15 | |||||||||||
| 16 | 1 | $cmd->config(\@config_files); | |||||||||
| 17 | |||||||||||
| 18 | 1 | $cmd->run(); | |||||||||
| 19 | |||||||||||
| 20 | =head1 NAME | ||||||||||
| 21 | dbix_changeset.pl - Manage database changesets | ||||||||||
| 22 | |||||||||||
| 23 | =head1 SYNOPSIS | ||||||||||
| 24 | dbix_changeset.pl <command> [options] | ||||||||||
| 25 | |||||||||||
| 26 | run dbix_changeset.pl commands to see list of commands and dbix_changeset.pl <command> --help | ||||||||||
| 27 | for the commands options. | ||||||||||
| 28 | |||||||||||
| 29 | =head1 DESCRIPTION | ||||||||||
| 30 | |||||||||||
| 31 | C<dbix_changeset.pl> is command-line interface to L<DBIx::Changeset>. | ||||||||||
| 32 | |||||||||||
| 33 | =head1 CONFIGURATION | ||||||||||
| 34 | |||||||||||
| 35 | dbix-changeset.pl will look for configuration files before reading its command line | ||||||||||
| 36 | parameters. It looks for the following files in order: | ||||||||||
| 37 | C</etc/dbix_changeset.yml>, C</usr/local/etc/dbix_changeset.yml>, C<$HOME/.dbix_changeset.yml> | ||||||||||
| 38 | each file will overwrite the values of the previous file. Also a list of configuration files | ||||||||||
| 39 | can be set through the DBIX_UPDATE_CONFIG environment variable that will be loaded instead. | ||||||||||
| 40 | |||||||||||
| 41 | The configuration file is in YAML format, and each option available to a command can be set | ||||||||||
| 42 | in the file either at the root or as a key for that command name. I.E: | ||||||||||
| 43 | |||||||||||
| 44 | db_name: testdb | ||||||||||
| 45 | db_user: dbuser | ||||||||||
| 46 | db_password: dbpassword | ||||||||||
| 47 | create: | ||||||||||
| 48 | template: '~/src/amarus/trunk/etc/delta_template.txt' | ||||||||||
| 49 | |||||||||||
| 50 | |||||||||||
| 51 | =head1 COPYRIGHT & LICENSE | ||||||||||
| 52 | |||||||||||
| 53 | Copyright 2004-2008 Grox Pty Ltd. | ||||||||||
| 54 | |||||||||||
| 55 | This program is free software; you can redistribute it and/or modify it | ||||||||||
| 56 | under the same terms as Perl itself. | ||||||||||
| 57 | |||||||||||
| 58 | The full text of the license can be found in the LICENSE file included with this module. | ||||||||||
| 59 | |||||||||||
| 60 | =cut | ||||||||||