| 1 | package Serge::Command::show; | ||||||||||
| 2 | 1 | ▶ | use parent Serge::Command; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use Config::Neat::Inheritable; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use Config::Neat::Render; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | sub get_commands { | ||||||||||
| 10 | return { | ||||||||||
| 11 | 0 | ▶ | show => { | ||||||||
|
Subroutine
get_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 12 | handler => \&run, | ||||||||||
| 13 | info => 'Show expanded version of a configuration file', | ||||||||||
| 14 | need_config => 1, | ||||||||||
| 15 | }, | ||||||||||
| 16 | } | ||||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | sub run { | ||||||||||
| 20 | 0 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
run: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 21 | |||||||||||
| 22 | 0 | my @config_files = $self->{parent}->get_config_files; | |||||||||
| 23 | 0 | ▶ | die "Multiple configuration files not allowed\n" unless $#config_files == 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | |||||||||||
| 25 | 0 | my $cfg = Config::Neat::Inheritable->new(); | |||||||||
| 26 | 0 | my $data = $cfg->parse_file($config_files[0]); | |||||||||
| 27 | |||||||||||
| 28 | 0 | my $renderer = Config::Neat::Render->new(); | |||||||||
| 29 | 0 | print $renderer->render($data); | |||||||||
| 30 | |||||||||||
| 31 | 0 | return 0; | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 1 | 1; | |||||||||