ExtractConfigComparator.pm 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. package Fcm::CLI::Invoker::ExtractConfigComparator;
  9. use base qw{Fcm::CLI::Invoker};
  10. use Cwd qw{cwd};
  11. use Fcm::ExtractConfigComparator;
  12. use Fcm::Config;
  13. ################################################################################
  14. # Invokes the sub-system
  15. sub invoke {
  16. my ($self) = @_;
  17. my ($cfg_file1, $cfg_file2) = $self->get_arguments();
  18. if (exists($self->get_options()->{verbose})) {
  19. Fcm::Config->instance()->verbose($self->get_options()->{verbose});
  20. }
  21. my $system = Fcm::ExtractConfigComparator->new({
  22. files => [$cfg_file1, $cfg_file2], wiki => $self->get_options()->{wiki},
  23. });
  24. $system->invoke();
  25. }
  26. 1;
  27. __END__
  28. =head1 NAME
  29. Fcm::CLI::ExtractInvoker
  30. =head1 SYNOPSIS
  31. use Fcm::CLI::Invoker::ExtractConfigComparator;
  32. $invoker = Fcm::CLI::Invoker::ExtractConfigComparator->new({
  33. command => $command,
  34. options => \%options,
  35. arguments => $arguments,
  36. });
  37. $invoker->invoke();
  38. =head1 DESCRIPTION
  39. This class extends L<Fcm::CLI::Invoker|Fcm::CLI::Invoker> an inherits all its
  40. methods. An object of this class is used to invoke the extract configuration
  41. comparator.
  42. =head1 METHODS
  43. See L<Fcm::CLI::Invoker|Fcm::CLI::Invoker> for a list of inherited methods.
  44. =over 4
  45. =item invoke()
  46. Invokes the extract configuration comparator.
  47. The I<wiki> option is mapped directly to that of the constructor of
  48. L<Fcm::ExtractConfigComparator|Fcm::ExtractConfigComparator> object.
  49. =back
  50. =head1 TO DO
  51. Unit tests.
  52. =head1 SEE ALSO
  53. L<Fcm::ExtractConfigComparator|Fcm::ExtractConfigComparator>,
  54. L<Fcm::CLI::Invoker|Fcm::CLI::Invoker>,
  55. L<Fcm::CLI::Subcommand|Fcm::CLI::Subcommand>
  56. =head1 COPYRIGHT
  57. E<169> Crown copyright Met Office. All rights reserved.
  58. =cut