File Coverage

bin/ubic
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 24 24 100.0


line stmt bran cond sub pod time code
1             #!/usr/bin/env perl
2             package ubic;
3             $ubic::VERSION = '1.60';
4 1     1   790 use strict;
  1         2  
  1         24  
5 1     1   3 use warnings;
  1         1  
  1         23  
6              
7             # ABSTRACT: command-line frontend to ubic services
8              
9              
10 1     1   3 use Getopt::Long 2.33;
  1         5  
  1         17  
11 1     1   519 use Pod::Usage;
  1         32503  
  1         115  
12              
13 1     1   7 use Ubic;
  1         1  
  1         15  
14 1     1   3 use Ubic::Cmd;
  1         1  
  1         133  
15              
16             return 1 if caller();
17             unless (grep { $_ eq '/usr/local/bin' } split /:/, $ENV{PATH}) {
18             $ENV{PATH} = "/usr/local/bin:$ENV{PATH}";
19             }
20              
21             my $force;
22             GetOptions(
23             'f|force' => \$force,
24             ) or pod2usage(2);
25              
26             if (
27             not @ARGV
28             or @ARGV == 1 and $ARGV[0] eq 'help'
29             ) {
30             pod2usage(2);
31             }
32              
33             my $command = shift @ARGV;
34             if (@ARGV) {
35             Ubic::Cmd->run({
36             name => [@ARGV],
37             command => $command,
38             force => $force,
39             });
40             }
41             else {
42             Ubic::Cmd->run({
43             name => undef,
44             command => $command,
45             force => $force,
46             });
47             }
48              
49             __END__