line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: show account info |
2
|
2
|
|
|
2
|
|
19616
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
74
|
|
3
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
110
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Smartcat::App::Command::account; |
6
|
2
|
|
|
2
|
|
13
|
use Smartcat::App -command; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
22
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
1942
|
use Smartcat::Client::AccountApi; |
|
2
|
|
|
|
|
6247
|
|
|
2
|
|
|
|
|
86
|
|
9
|
2
|
|
|
2
|
|
20
|
use Smartcat::App::Utils; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
216
|
|
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
14
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
136
|
|
12
|
|
|
|
|
|
|
$Carp::Internal{ ('Smartcat::Client::AccountApi') }++; |
13
|
2
|
|
|
2
|
|
13
|
use Log::Any qw($log); |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
18
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub execute { |
16
|
0
|
|
|
0
|
1
|
|
my ( $self, $opt, $args ) = @_; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my $api = Smartcat::Client::AccountApi->new( $self->app->{api} ); |
19
|
0
|
|
|
|
|
|
my $account_info = eval { $api->account_get_account_info }; |
|
0
|
|
|
|
|
|
|
20
|
0
|
0
|
|
|
|
|
die $log->error( |
21
|
|
|
|
|
|
|
sprintf( "Failed to get account info.\nError:\n%s", |
22
|
|
|
|
|
|
|
format_error_message($@) ) |
23
|
|
|
|
|
|
|
) unless $account_info; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
print "Account Info\n Name: " |
26
|
|
|
|
|
|
|
. $account_info->name |
27
|
|
|
|
|
|
|
. "\n Id: " |
28
|
|
|
|
|
|
|
. $account_info->id . "\n"; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |