5 |
|
use File::Copy; |
6 |
|
use Getopt::Long; |
7 |
|
use POSIX; |
8 |
+ |
use Term::ANSIColor; |
9 |
|
|
10 |
|
sub printHelp; |
11 |
|
sub outputPset; |
198 |
|
for (my $i = 1; $i <= $results->numrows (); $i++) |
199 |
|
{ |
200 |
|
my @row = $results->fetchrow (); |
201 |
+ |
$row[2] =~ s/([^ ]*) [^ ]*/$1/g; |
202 |
|
$map{"$i"} = [$row[3], $row[4], $row[5], $row[7]] if $row[7]; |
203 |
|
$map{"$i"} = [$row[3], $row[4], $row[5], $row[6]] if !$row[7]; |
204 |
|
printf "(%2d) $row[0]\n", $i; |
205 |
< |
print " created by $row[1] on $row[2]\n"; |
205 |
> |
print " ("; |
206 |
> |
print color "green" if $row[5] eq "present"; |
207 |
> |
print color "bold yellow" if $row[5] eq "submitted"; |
208 |
> |
print color "bold red" if $row[5] eq "created" or $row[5] eq "cancelled" or $row[5] eq "deprecated"; |
209 |
> |
print $row[5]; |
210 |
> |
print color "reset"; |
211 |
> |
print ") created by $row[1] on $row[2]\n"; |
212 |
|
} |
213 |
|
print "\nWhich dataset would you like to use?: "; |
214 |
|
my $response = <STDIN>; |