File: alzabo_grep

package info (click to toggle)
libalzabo-perl 0.92-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,172 kB
  • ctags: 794
  • sloc: perl: 15,060; makefile: 4
file content (29 lines) | stat: -rwxr-xr-x 459 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/perl -w

use strict;

use Alzabo::Create;

my ($re, $schema) = @ARGV;

unless ( defined $re && defined $schema )
{
    print "Usage: alzabo_grep  regex  schema\n";
    exit;
}

my $s = Alzabo::Create::Schema->load_from_file( name => $schema );

print "\n";

$re = qr/$re/;
foreach my $t ( $s->tables )
{
    foreach my $c ( $t->columns )
    {
        print $t->name . ' . ' . $c->name . "\n"
            if $c->name =~ /$re/;
    }
}

print "\n";