line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Cmd::touch; |
2
|
|
|
|
|
|
|
|
3
|
14
|
|
|
14
|
|
136811
|
use Catmandu::Sane; |
|
14
|
|
|
|
|
52
|
|
|
14
|
|
|
|
|
89
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
6
|
|
|
|
|
|
|
|
7
|
14
|
|
|
14
|
|
117
|
use parent 'Catmandu::Cmd'; |
|
14
|
|
|
|
|
33
|
|
|
14
|
|
|
|
|
83
|
|
8
|
14
|
|
|
14
|
|
1038
|
use Catmandu; |
|
14
|
|
|
|
|
40
|
|
|
14
|
|
|
|
|
104
|
|
9
|
14
|
|
|
14
|
|
3050
|
use namespace::clean; |
|
14
|
|
|
|
|
42
|
|
|
14
|
|
|
|
|
82
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub command_opt_spec { |
12
|
1
|
|
|
1
|
1
|
20
|
(["key|field=s", "", {required => 1}], ["format=s", ""],); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub command { |
16
|
1
|
|
|
1
|
1
|
4
|
my ($self, $opts, $args) = @_; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
7
|
my ($from_args, $from_opts) = $self->_parse_options($args); |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
3
|
my $from_bag = delete $from_opts->{bag}; |
21
|
1
|
|
|
|
|
9
|
my $from = Catmandu->store($from_args->[0], $from_opts)->bag($from_bag); |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
24
|
$from->touch($opts->key, $opts->format); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=pod |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 NAME |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Catmandu::Cmd::touch - add the current datetime to the items in a bag |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 EXAMPLES |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
catmandu touch <STORE> <OPTIONS> |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
catmandu touch MongoDB --index-name shop --bag products --field date_updated |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |