Subversion Repositories DevTools

Rev

Rev 261 | Rev 271 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 261 Rev 267
Line 24... Line 24...
24
use DBI;
24
use DBI;
25
 
25
 
26
my $VERSION = "1.0.0";                      # Update this
26
my $VERSION = "1.0.0";                      # Update this
27
my $opt_verbose = 1;
27
my $opt_verbose = 1;
28
my $opt_help = 0;
28
my $opt_help = 0;
29
my $opt_manual;
-
 
30
my $opt_repeat;
29
my $opt_repeat;
31
my $opt_short;
30
my $opt_short = 0;
32
my $opt_color;
31
my $opt_color;
33
my @opt_rtag;
32
my @opt_rtag;
34
my %opt_rtag;
33
my %opt_rtag;
35
my $opt_filter;
34
my $opt_filter;
36
my $RM_DB;
35
my $RM_DB;
Line 51... Line 50...
51
# Inputs          :
50
# Inputs          :
52
#
51
#
53
# Returns         :
52
# Returns         :
54
#
53
#
55
my $result = GetOptions (
54
my $result = GetOptions (
56
                "help+"         => \$opt_help,          # flag, multiple use allowed
55
                "help:+"        => \$opt_help,          # flag, multiple use allowed
57
                "manual"        => \$opt_manual,        # flag
56
                "manual:3"      => \$opt_help,          # flag
58
                "verbose+"      => \$opt_verbose,       # flag
57
                "verbose:+"     => \$opt_verbose,      # flag
59
                "repeat=i"      => \$opt_repeat,        # Integer
58
                "repeat=i"      => \$opt_repeat,        # Integer
60
                "short"         => \$opt_short,         # Flag
59
                "short:+"       => \$opt_short,         # Flag
61
                "color"         => \$opt_color,         # Flag
60
                "color"         => \$opt_color,         # Flag
62
                "rtag=s"        => \@opt_rtag,          # Array
61
                "rtag=s"        => \@opt_rtag,          # Array
63
                "filter"        => \$opt_filter,        # Flag
62
                "filter"        => \$opt_filter,        # Flag
64
                );
63
                );
65
 
64
 
66
#
65
#
67
#   Process help and manual options
66
#   Process help and manual options
68
#
67
#
69
pod2usage(-verbose => 0, -message => "Version: $VERSION")  if ($opt_help == 1  || ! $result);
68
pod2usage(-verbose => 0, -message => "Version: $VERSION")  if ($opt_help == 1  || ! $result);
70
pod2usage(-verbose => 1)  if ($opt_help == 2 );
69
pod2usage(-verbose => 1)  if ($opt_help == 2 );
71
pod2usage(-verbose => 2)  if ($opt_manual || ($opt_help > 2));
70
pod2usage(-verbose => 2)  if ($opt_help > 2);
72
 
71
 
73
ErrorConfig( 'name'    =>'DSTATUS' );
72
ErrorConfig( 'name'    =>'DSTATUS' );
74
 
73
 
75
#
74
#
76
#   Native windows doesn't handle color
75
#   Native windows doesn't handle color
Line 106... Line 105...
106
    GetRunData();
105
    GetRunData();
107
    DisplayInfo();
106
    DisplayInfo();
108
 
107
 
109
    last unless ( $opt_repeat );
108
    last unless ( $opt_repeat );
110
    sleep ($opt_repeat );
109
    sleep ($opt_repeat );
-
 
110
 
-
 
111
    #
-
 
112
    #   Cleanout any data from previous run
-
 
113
    #
-
 
114
    %pname = ();
-
 
115
    %rc = ();
-
 
116
    %rl = ();
-
 
117
    %rname = ();
-
 
118
    %official = ();
-
 
119
    
111
}
120
}
112
 
121
 
113
disconnectRM(\$RM_DB);
122
disconnectRM(\$RM_DB);
114
exit;
123
exit;
115
 
124
 
Line 146... Line 155...
146
    foreach my $pname ( sort keys %pname )
155
    foreach my $pname ( sort keys %pname )
147
    {
156
    {
148
        foreach my $rname ( sort keys %{$pname{$pname}} )
157
        foreach my $rname ( sort keys %{$pname{$pname}} )
149
        {
158
        {
150
            my $rtag_id = $pname{$pname}{$rname};
159
            my $rtag_id = $pname{$pname}{$rname};
151
 
-
 
152
            print BOLD GREEN "[$rtag_id] $rname{$rtag_id} ($official{$rtag_id})", RESET, "\n";
-
 
153
            my @orderm;
160
            my @orderm;
154
            my @orders;
161
            my @orders;
155
            my $building = 0;
162
            my $building = 0;
156
 
163
 
157
            foreach my $rcon_id ( keys %{$rc{$rtag_id}}  )
164
            foreach my $rcon_id ( keys %{$rc{$rtag_id}}  )
Line 174... Line 181...
174
                {
181
                {
175
                    push @orders, $rcon_id;
182
                    push @orders, $rcon_id;
176
                }
183
                }
177
            }
184
            }
178
 
185
 
-
 
186
            if ( $building || $opt_short < 2  )
-
 
187
            {
-
 
188
                print BOLD GREEN "[$rtag_id] $rname{$rtag_id} ($official{$rtag_id})", RESET, "\n";
-
 
189
            }
-
 
190
            
179
            if ( $building || !$opt_short  )
191
            if ( $building || $opt_short < 1 )
180
            {
192
            {
181
                foreach my $rcon_id ( @orderm, sort(@orders) )
193
                foreach my $rcon_id ( @orderm, sort(@orders) )
182
                {
194
                {
183
                    if ( $opt_filter )
195
                    if ( $opt_filter )
184
                    {
196
                    {
Line 434... Line 446...
434
    -help              - brief help message
446
    -help              - brief help message
435
    -help -help        - Detailed help message
447
    -help -help        - Detailed help message
436
    -man               - Full documentation
448
    -man               - Full documentation
437
    -repeat=num        - Repeat display every n seconds
449
    -repeat=num        - Repeat display every n seconds
438
    -short             - Fold up inactive releases
450
    -short             - Fold up inactive releases
-
 
451
    -short -short      - Supress inactive releases
439
    -color             - Pretty color display
452
    -color             - Pretty color display
440
    -rtag=num[,num]    - List of RTAG Ids to display
453
    -rtag=num[,num]    - List of RTAG Ids to display
441
    -filter            - Display GBE_BUILDFILTER
454
    -filter            - Display GBE_BUILDFILTER
442
 
455
 
443
=head1 OPTIONS
456
=head1 OPTIONS
Line 471... Line 484...
471
 
484
 
472
This option will generate a short display. The body of inactive releases will
485
This option will generate a short display. The body of inactive releases will
473
not be displayed. This option is useful in conjunction with a repeating display
486
not be displayed. This option is useful in conjunction with a repeating display
474
to limit the display space used.
487
to limit the display space used.
475
 
488
 
-
 
489
If B<-short> is used twice then the header for inactive releases will also
-
 
490
be supressed.
-
 
491
 
476
=item B<-color>
492
=item B<-color>
477
 
493
 
478
This option will enable a colored display. This will not work on Windoes.
494
This option will enable a colored display. This will not work on Windoes.
479
The default is for a non-colored display.
495
The default is for a non-colored display.
480
 
496