line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: show/edit config file |
2
|
2
|
|
|
2
|
|
1361
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
63
|
|
3
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
83
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Smartcat::App::Command::config; |
6
|
2
|
|
|
2
|
|
11
|
use Smartcat::App -command; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
15
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
579
|
use File::Basename; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
637
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub validate_args { |
11
|
0
|
|
|
0
|
1
|
|
my ( $self, $opt, $args ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
|
|
|
my $app = $self->app; |
14
|
|
|
|
|
|
|
|
15
|
0
|
0
|
|
|
|
|
$app->{config}->{username} = $opt->{token_id} if defined $opt->{token_id}; |
16
|
0
|
0
|
|
|
|
|
$app->{config}->{password} = $opt->{token} if defined $opt->{token}; |
17
|
0
|
0
|
|
|
|
|
$app->{config}->{base_url} = $opt->{base_url} if defined $opt->{base_url}; |
18
|
|
|
|
|
|
|
|
19
|
0
|
0
|
|
|
|
|
if ( defined $opt->{log} ) { |
20
|
|
|
|
|
|
|
$self->usage_error( |
21
|
|
|
|
|
|
|
"directory of 'log', which is set to '$opt->{log}', does not point to a valid directory" |
22
|
0
|
0
|
0
|
|
|
|
) unless -d dirname( $opt->{log} ) && -w _; |
23
|
0
|
|
|
|
|
|
$app->{config}->{log} = $opt->{log}; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
$app->{config}->save; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub execute { |
30
|
0
|
|
|
0
|
1
|
|
my ( $self, $opt, $args ) = @_; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
my $app = $self->app->{config}->cat; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |