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