File Coverage

blib/lib/App/Spec/Option.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition 2 2 100.0
subroutine 5 5 100.0
pod 1 1 100.0
total 24 24 100.0


line stmt bran cond sub pod time code
1             # ABSTRACT: App::Spec objects representing command line option specs
2 10     10   292675 use strict;
  10         18  
  10         402  
3 10     10   66 use warnings;
  10         34  
  10         920  
4             package App::Spec::Option;
5              
6             our $VERSION = 'v0.15.0'; # VERSION
7              
8 10     10   69 use base 'App::Spec::Argument';
  10         18  
  10         8738  
9 10     10   129 use Moo;
  10         35  
  10         60  
10              
11             has aliases => ( is => 'ro' );
12              
13             sub build {
14 503     503 1 2816 my ($class, %args) = @_;
15 503         2786 my %hash = $class->common(%args);
16             my $self = $class->new({
17 503   100     22325 aliases => $args{aliases} || [],
18             %hash,
19             });
20 503         40278 return $self;
21             }
22              
23             1;
24              
25             =pod
26              
27             =head1 NAME
28              
29             App::Spec::Option - App::Spec objects representing command line option specs
30              
31             =head1 SYNOPSIS
32              
33             This class inherits from L
34              
35             =head1 METHODS
36              
37             =over 4
38              
39             =item build
40              
41             my $option = App::Spec::Option->build(
42             name => 'verbose',
43             summary => 'lala',
44             aliases => ['v'],
45             );
46              
47             =item aliases
48              
49             Attribute which represents the one from the spec.
50              
51             =back
52              
53             =cut