[1980] | 1 | # ------------------------------------------------------------------------------ |
---|
| 2 | # (C) Crown copyright Met Office. All rights reserved. |
---|
| 3 | # For further details please refer to the file COPYRIGHT.txt |
---|
| 4 | # which you should have received as part of this distribution. |
---|
| 5 | # ------------------------------------------------------------------------------ |
---|
| 6 | use strict; |
---|
| 7 | use warnings; |
---|
| 8 | |
---|
| 9 | package Fcm::CLI::Invoker::ExtractConfigComparator; |
---|
| 10 | use base qw{Fcm::CLI::Invoker}; |
---|
| 11 | |
---|
| 12 | use Cwd qw{cwd}; |
---|
| 13 | use Fcm::ExtractConfigComparator; |
---|
| 14 | use Fcm::Config; |
---|
| 15 | |
---|
| 16 | ################################################################################ |
---|
| 17 | # Invokes the sub-system |
---|
| 18 | sub invoke { |
---|
| 19 | my ($self) = @_; |
---|
| 20 | my ($cfg_file1, $cfg_file2) = $self->get_arguments(); |
---|
| 21 | if (exists($self->get_options()->{verbose})) { |
---|
| 22 | Fcm::Config->instance()->verbose($self->get_options()->{verbose}); |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | my $system = Fcm::ExtractConfigComparator->new({ |
---|
| 26 | files => [$cfg_file1, $cfg_file2], wiki => $self->get_options()->{wiki}, |
---|
| 27 | }); |
---|
| 28 | $system->invoke(); |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | 1; |
---|
| 32 | __END__ |
---|
| 33 | |
---|
| 34 | =head1 NAME |
---|
| 35 | |
---|
| 36 | Fcm::CLI::ExtractInvoker |
---|
| 37 | |
---|
| 38 | =head1 SYNOPSIS |
---|
| 39 | |
---|
| 40 | use Fcm::CLI::Invoker::ExtractConfigComparator; |
---|
| 41 | $invoker = Fcm::CLI::Invoker::ExtractConfigComparator->new({ |
---|
| 42 | command => $command, |
---|
| 43 | options => \%options, |
---|
| 44 | arguments => $arguments, |
---|
| 45 | }); |
---|
| 46 | $invoker->invoke(); |
---|
| 47 | |
---|
| 48 | =head1 DESCRIPTION |
---|
| 49 | |
---|
| 50 | This class extends L<Fcm::CLI::Invoker|Fcm::CLI::Invoker> an inherits all its |
---|
| 51 | methods. An object of this class is used to invoke the extract configuration |
---|
| 52 | comparator. |
---|
| 53 | |
---|
| 54 | =head1 METHODS |
---|
| 55 | |
---|
| 56 | See L<Fcm::CLI::Invoker|Fcm::CLI::Invoker> for a list of inherited methods. |
---|
| 57 | |
---|
| 58 | =over 4 |
---|
| 59 | |
---|
| 60 | =item invoke() |
---|
| 61 | |
---|
| 62 | Invokes the extract configuration comparator. |
---|
| 63 | |
---|
| 64 | The I<wiki> option is mapped directly to that of the constructor of |
---|
| 65 | L<Fcm::ExtractConfigComparator|Fcm::ExtractConfigComparator> object. |
---|
| 66 | |
---|
| 67 | =back |
---|
| 68 | |
---|
| 69 | =head1 TO DO |
---|
| 70 | |
---|
| 71 | Unit tests. |
---|
| 72 | |
---|
| 73 | =head1 SEE ALSO |
---|
| 74 | |
---|
| 75 | L<Fcm::ExtractConfigComparator|Fcm::ExtractConfigComparator>, |
---|
| 76 | L<Fcm::CLI::Invoker|Fcm::CLI::Invoker>, |
---|
| 77 | L<Fcm::CLI::Subcommand|Fcm::CLI::Subcommand> |
---|
| 78 | |
---|
| 79 | =head1 COPYRIGHT |
---|
| 80 | |
---|
| 81 | E<169> Crown copyright Met Office. All rights reserved. |
---|
| 82 | |
---|
| 83 | =cut |
---|