| 1 | package Catmandu::Cmd::compile; | ||||||||||
| 2 | |||||||||||
| 3 | 14 | ▶ | use Catmandu::Sane; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 14 | our $VERSION = '1.2025'; | |||||||||
| 6 | |||||||||||
| 7 | 14 | ▶ | use parent 'Catmandu::Cmd'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 14 | ▶ | use Catmandu; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 14 | ▶ | use Data::Dumper; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 14 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 1 | ▶ | sub command_opt_spec { | ||||||||
|
Subroutine
command_opt_spec: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 13 | ( | ||||||||||
| 14 | 1 | ["var=s%", ""], | |||||||||
| 15 | ["preprocess|pp", ""], | ||||||||||
| 16 | ["fix|fix=s@", "", {hidden => 1}], | ||||||||||
| 17 | ); | ||||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 1 | ▶ | sub command { | ||||||||
|
Subroutine
command: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||
| 21 | 1 | my ($self, $opts, $args) = @_; | |||||||||
| 22 | |||||||||||
| 23 | 1 | ▶ | unless (@$args == 1) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 0 | say STDERR "usage: $0 compile <FILE>|<FIX> [<FILE>|<FIX> [...]]\n"; | |||||||||
| 25 | 0 | exit 1; | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 1 | $opts->{fix} = $args; | |||||||||
| 29 | |||||||||||
| 30 | 1 | my $fixer = $self->_build_fixer($opts); | |||||||||
| 31 | 1 | my $fixes = $fixer->emit; | |||||||||
| 32 | 1 | my $captures = Dumper($fixer->_captures); | |||||||||
| 33 | |||||||||||
| 34 | 1 | $captures =~ s/^\$VAR1/\$_[1]/; | |||||||||
| 35 | |||||||||||
| 36 | 1 | print $captures; | |||||||||
| 37 | 1 | print $fixes; | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 14 | 1; | |||||||||
| 41 | |||||||||||
| 42 | __END__ | ||||||||||