line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::BitBucketCli::Command::Repositories; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Created on: 2018-06-07 08:23:20 |
4
|
|
|
|
|
|
|
# Create by: Ivan Wills |
5
|
|
|
|
|
|
|
# $Id$ |
6
|
|
|
|
|
|
|
# $Revision$, $HeadURL$, $Date$ |
7
|
|
|
|
|
|
|
# $Revision$, $Source$, $Date$ |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
916
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
10
|
1
|
|
|
1
|
|
252
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
11
|
1
|
|
|
1
|
|
13
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
47
|
|
12
|
1
|
|
|
1
|
|
5
|
use Data::Dumper qw/Dumper/; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
42
|
|
13
|
1
|
|
|
1
|
|
6
|
use English qw/ -no_match_vars /; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
extends 'App::BitBucketCli'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $VERSION = 0.009; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub options { |
20
|
0
|
|
|
0
|
1
|
|
return [qw/ |
21
|
|
|
|
|
|
|
colors|c=s% |
22
|
|
|
|
|
|
|
force|f! |
23
|
|
|
|
|
|
|
long|l |
24
|
|
|
|
|
|
|
project|p=s |
25
|
|
|
|
|
|
|
regexp|R |
26
|
|
|
|
|
|
|
remote|m=s |
27
|
|
|
|
|
|
|
repository|r=s |
28
|
|
|
|
|
|
|
sleep|s=i |
29
|
|
|
|
|
|
|
/] |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub repositories { |
33
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
my @repositories = sort { |
36
|
0
|
|
|
|
|
|
lc $a->name cmp lc $b->name; |
37
|
|
|
|
|
|
|
} |
38
|
0
|
|
|
|
|
|
$self->core->repositories($self->opt->{project}); |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
my %len; |
41
|
0
|
|
|
|
|
|
for my $repository (@repositories) { |
42
|
0
|
0
|
0
|
|
|
|
$len{name} = length $repository->name if !$len{name} || $len{name} < length $repository->name; |
43
|
0
|
0
|
0
|
|
|
|
$len{state} = length $repository->state if !$len{state} || $len{state} < length $repository->state; |
44
|
|
|
|
|
|
|
} |
45
|
0
|
|
|
|
|
|
for my $repository (@repositories) { |
46
|
0
|
0
|
|
|
|
|
if ( $self->opt->long ) { |
47
|
0
|
|
|
|
|
|
printf "%-$len{name}s %-$len{state}s %s\n", $repository->name, $repository->state, $repository->self; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
else { |
50
|
0
|
|
|
|
|
|
print $repository->name . "\n"; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 NAME |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
App::BitBucketCli::Command::Repositories - Show all the repositories of a project |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 VERSION |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
This documentation refers to App::BitBucketCli::Command::Repositories version 0.009 |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 SYNOPSIS |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
bb-cli repositories [options] |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
OPTIONS: |
72
|
|
|
|
|
|
|
-c --colors[=]str Change colours used specified as key=value |
73
|
|
|
|
|
|
|
eg --colors disabled=grey22 |
74
|
|
|
|
|
|
|
current colour names aborted, disabled and notbuilt |
75
|
|
|
|
|
|
|
-f --force Force action |
76
|
|
|
|
|
|
|
-l --long Show long form data if possible |
77
|
|
|
|
|
|
|
-p --project[=]str |
78
|
|
|
|
|
|
|
For commands that need a project name this is the name to use |
79
|
|
|
|
|
|
|
-R --recipient[=]str |
80
|
|
|
|
|
|
|
?? |
81
|
|
|
|
|
|
|
-R --regexp[=]str ?? |
82
|
|
|
|
|
|
|
-m --remote[=]str ?? |
83
|
|
|
|
|
|
|
-r --repository[=]str |
84
|
|
|
|
|
|
|
For commands that work on repositories this contains the repository |
85
|
|
|
|
|
|
|
-s --sleep[=]seconds |
86
|
|
|
|
|
|
|
?? |
87
|
|
|
|
|
|
|
-t --test ?? |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
CONFIGURATION: |
90
|
|
|
|
|
|
|
-h --host[=]str Specify the Stash/Bitbucket Servier host name |
91
|
|
|
|
|
|
|
-P --password[=]str |
92
|
|
|
|
|
|
|
The password to connect to the server as |
93
|
|
|
|
|
|
|
-u --username[=]str |
94
|
|
|
|
|
|
|
The username to connect to the server as |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
-v --verbose Show more detailed option |
97
|
|
|
|
|
|
|
--version Prints the version information |
98
|
|
|
|
|
|
|
--help Prints this help information |
99
|
|
|
|
|
|
|
--man Prints the full documentation for bb-cli |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 DESCRIPTION |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head2 C<options ()> |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Returns the command line options |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head2 C<repositories ()> |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 DIAGNOSTICS |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 CONFIGURATION AND ENVIRONMENT |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head1 INCOMPATIBILITIES |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head1 BUGS AND LIMITATIONS |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
There are no known bugs in this module. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Please report problems to Ivan Wills (ivan.wills@gmail.com). |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Patches are welcome. |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head1 AUTHOR |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
Ivan Wills - (ivan.wills@gmail.com) |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
Copyright (c) 2018 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077). |
134
|
|
|
|
|
|
|
All rights reserved. |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
This module is free software; you can redistribute it and/or modify it under |
137
|
|
|
|
|
|
|
the same terms as Perl itself. See L<perlartistic>. This program is |
138
|
|
|
|
|
|
|
distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
139
|
|
|
|
|
|
|
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
140
|
|
|
|
|
|
|
PARTICULAR PURPOSE. |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=cut |