line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ************************************************************************* |
2
|
|
|
|
|
|
|
# Copyright (c) 2014-2016, SUSE LLC |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# All rights reserved. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Redistribution and use in source and binary forms, with or without |
7
|
|
|
|
|
|
|
# modification, are permitted provided that the following conditions are met: |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# 1. Redistributions of source code must retain the above copyright notice, |
10
|
|
|
|
|
|
|
# this list of conditions and the following disclaimer. |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright |
13
|
|
|
|
|
|
|
# notice, this list of conditions and the following disclaimer in the |
14
|
|
|
|
|
|
|
# documentation and/or other materials provided with the distribution. |
15
|
|
|
|
|
|
|
# |
16
|
|
|
|
|
|
|
# 3. Neither the name of SUSE LLC nor the names of its contributors may be |
17
|
|
|
|
|
|
|
# used to endorse or promote products derived from this software without |
18
|
|
|
|
|
|
|
# specific prior written permission. |
19
|
|
|
|
|
|
|
# |
20
|
|
|
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
21
|
|
|
|
|
|
|
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
22
|
|
|
|
|
|
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
23
|
|
|
|
|
|
|
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
24
|
|
|
|
|
|
|
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
25
|
|
|
|
|
|
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
26
|
|
|
|
|
|
|
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
27
|
|
|
|
|
|
|
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
28
|
|
|
|
|
|
|
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
29
|
|
|
|
|
|
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
30
|
|
|
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE. |
31
|
|
|
|
|
|
|
# ************************************************************************* |
32
|
|
|
|
|
|
|
# |
33
|
|
|
|
|
|
|
# top-level CLI module |
34
|
|
|
|
|
|
|
# |
35
|
|
|
|
|
|
|
package App::Dochazka::CLI; |
36
|
|
|
|
|
|
|
|
37
|
23
|
|
|
23
|
|
315191
|
use 5.012; |
|
23
|
|
|
|
|
65
|
|
38
|
23
|
|
|
23
|
|
73
|
use strict; |
|
23
|
|
|
|
|
23
|
|
|
23
|
|
|
|
|
346
|
|
39
|
23
|
|
|
23
|
|
70
|
use warnings; |
|
23
|
|
|
|
|
27
|
|
|
23
|
|
|
|
|
492
|
|
40
|
|
|
|
|
|
|
|
41
|
23
|
|
|
23
|
|
896
|
use App::CELL qw( $CELL ); |
|
23
|
|
|
|
|
116733
|
|
|
23
|
|
|
|
|
1522
|
|
42
|
23
|
|
|
23
|
|
91
|
use Data::Dumper; |
|
23
|
|
|
|
|
25
|
|
|
23
|
|
|
|
|
964
|
|
43
|
23
|
|
|
23
|
|
77
|
use Exporter 'import'; |
|
23
|
|
|
|
|
24
|
|
|
23
|
|
|
|
|
486
|
|
44
|
23
|
|
|
23
|
|
12649
|
use Test::More; |
|
23
|
|
|
|
|
275330
|
|
|
23
|
|
|
|
|
150
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 NAME |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
App::Dochazka::CLI - Dochazka command line client |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 VERSION |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Version 0.238 |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
our $VERSION = '0.238'; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 SYNOPSIS |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Dochazka command line client. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
bash$ dochazka-cli |
69
|
|
|
|
|
|
|
Dochazka(2014-08-08) demo> |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 DESCRIPTION |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
L is the Command Line Interface (CLI) component of the |
76
|
|
|
|
|
|
|
Dochazka Attendance & Time Tracking system. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
In order to work, the CLI must be pointed at a running L |
79
|
|
|
|
|
|
|
(i.e., Dochazka REST server) instance by setting the C<< MREST_CLI_URI_BASE >> |
80
|
|
|
|
|
|
|
meta configuration parameter. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Detailed documentation covering configuration, deployment, and the commands |
83
|
|
|
|
|
|
|
that can be used with the CLI can be found in L. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This module is used to store some "global" package variables that are used |
86
|
|
|
|
|
|
|
throughout the CLI code base. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 PACKAGE VARIABLES AND EXPORTS |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=over |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=item * C<< $current_emp >> |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
The L object of the current employee. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=item * C<< $current_priv >> |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
The privlevel of the current employee. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=item * C<< $debug_mode >> |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Tells parser whether to display debug messages |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=item * C<< $prompt_century >> |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
The century component of C<< $prompt_date >>; see L |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=item * C<< $prompt_date >> |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
The date displayed in the prompt -- see C and L |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=item * C<< $prompt_day >> |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
The day component of C<< $prompt_date >>; see L |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=item * C<< $prompt_month >> |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
The month component of C<< $prompt_date >>; see L |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=item * C<< $prompt_year >> |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
The year component of C<< $prompt_date >>; see L |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=back |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=cut |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
our @EXPORT_OK = qw( |
130
|
|
|
|
|
|
|
$current_emp |
131
|
|
|
|
|
|
|
$current_priv |
132
|
|
|
|
|
|
|
$debug_mode |
133
|
|
|
|
|
|
|
$prompt_century |
134
|
|
|
|
|
|
|
$prompt_date |
135
|
|
|
|
|
|
|
$prompt_day |
136
|
|
|
|
|
|
|
$prompt_month |
137
|
|
|
|
|
|
|
$prompt_year |
138
|
|
|
|
|
|
|
); |
139
|
|
|
|
|
|
|
our ( |
140
|
|
|
|
|
|
|
$current_emp, |
141
|
|
|
|
|
|
|
$current_priv, |
142
|
|
|
|
|
|
|
$debug_mode, |
143
|
|
|
|
|
|
|
$prompt_date, |
144
|
|
|
|
|
|
|
$prompt_century, |
145
|
|
|
|
|
|
|
$prompt_year, |
146
|
|
|
|
|
|
|
$prompt_month, |
147
|
|
|
|
|
|
|
$prompt_day, |
148
|
|
|
|
|
|
|
); |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
1; |