line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: show account info |
2
|
2
|
|
|
2
|
|
18488
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
69
|
|
3
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
90
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Smartcat::App::Command::account; |
6
|
2
|
|
|
2
|
|
11
|
use Smartcat::App -command; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
19
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
1839
|
use Smartcat::Client::AccountApi; |
|
2
|
|
|
|
|
6224
|
|
|
2
|
|
|
|
|
63
|
|
9
|
2
|
|
|
2
|
|
14
|
use Smartcat::App::Utils; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
206
|
|
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
20
|
use Carp; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
121
|
|
12
|
|
|
|
|
|
|
$Carp::Internal{ ('Smartcat::Client::AccountApi') }++; |
13
|
2
|
|
|
2
|
|
15
|
use Log::Any qw($log); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
10
|
|
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; |