File Coverage

blib/lib/App/Dochazka/CLI/Commands/Priv.pm
Criterion Covered Total %
statement 32 33 96.9
branch 2 4 50.0
condition n/a
subroutine 11 11 100.0
pod 1 1 100.0
total 46 49 93.8


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             # Priv commands
34             package App::Dochazka::CLI::Commands::Priv;
35              
36 20     20   254 use 5.012;
  20         40  
37 20     20   62 use strict;
  20         22  
  20         272  
38 20     20   52 use warnings;
  20         20  
  20         371  
39              
40 20     20   55 use App::CELL qw( $CELL );
  20         18  
  20         1392  
41 20     20   78 use App::Dochazka::CLI qw( $debug_mode );
  20         21  
  20         1267  
42 20     20   75 use App::Dochazka::CLI::Shared qw( show_as_at );
  20         23  
  20         678  
43 20     20   66 use App::Dochazka::CLI::Util qw( parse_test );
  20         17  
  20         591  
44 20     20   62 use Data::Dumper;
  20         20  
  20         585  
45 20     20   79 use Exporter 'import';
  20         18  
  20         455  
46 20     20   60 use Web::MREST::CLI qw( send_req );
  20         30  
  20         2150  
47              
48              
49              
50              
51             =head1 NAME
52              
53             App::Dochazka::CLI::Commands::Priv - Priv commands
54              
55              
56              
57              
58             =head1 PACKAGE VARIABLES
59              
60             =cut
61              
62             our @EXPORT_OK = qw(
63             show_priv_as_at
64             );
65              
66              
67              
68              
69             =head1 FUNCTIONS
70              
71             The functions in this module are called from the parser when it recognizes a command.
72              
73              
74             =head2 Command handlers
75              
76             Functions called from the parser
77              
78              
79              
80             =head3 show_priv_as_at
81              
82             PRIV
83             EMPLOYEE_SPEC PRIV
84             PRIV _DATE
85             EMPLOYEE_SPEC PRIV _DATE
86              
87             =cut
88              
89             sub show_priv_as_at {
90 2 50   2 1 6 print "Entering " . __PACKAGE__ . "::show_priv_as_at\n" if $debug_mode;
91 2         5 my ( $ts, $th ) = @_;
92              
93             # parse test
94 2 50       7 return parse_test( $ts, $th ) if $ts eq 'PARSE_TEST';
95              
96 0           return show_as_at( 'priv', $th );
97             }
98              
99              
100             1;