| 1 | package App::SFDC; | ||
| 2 | # ABSTRACT: Implements the SFDC command-line application | ||
| 3 | |||
| 4 | use strict; | ||
| 5 | use warnings; | ||
| 6 | use 5.12.0; | ||
| 7 | |||
| 8 | our $VERSION = '0.14'; # TRIAL VERSION | ||
| 9 | |||
| 10 | use File::Find 'find'; | ||
| 11 | |||
| 12 | our @commands; | ||
| 13 | |||
| 14 | sub import { | ||
| 15 | my $class = shift; | ||
| 16 | |||
| 17 | @commands = @_ | ||
| 18 | or find | ||
| 19 | { | ||
| 20 | wanted => sub {push @commands, $1 if m'App/SFDC/Command/(\w*)\.pm'}, | ||
| 21 | no_chdir => 1 | ||
| 22 | }, | ||
| 23 | grep {-e} map {$_.'/App/SFDC'} @INC; | ||
| 24 | |||
| 25 | # Deduplication: | ||
| 26 | my %commands = map {$_ => 1} @commands; | ||
| 27 | @commands = sort keys %commands; | ||
| 28 | |||
| 29 | require "App/SFDC/Command/$_.pm" for @commands; ## no critic | ||
| 30 | } | ||
| 31 | |||
| 32 | 1; | ||
| 33 | |||
| 34 | =pod | ||
| 35 | |||
| 36 | =head1 NAME | ||
| 37 | |||
| 38 | App::SFDC - Implements the SFDC command-line application | ||
| 39 | |||
| 40 | =head1 VERSION | ||
| 41 | |||
| 42 | version 0.14 | ||
| 43 | |||
| 44 | =head1 AUTHOR | ||
| 45 | |||
| 46 | Alexander Brett <alexander.brett@sophos.com> L<http://alexander-brett.co.uk> | ||
| 47 | |||
| 48 | =head1 COPYRIGHT AND LICENSE | ||
| 49 | |||
| 50 | This software is Copyright (c) 2015 by Sophos Limited L<https://www.sophos.com/>. | ||
| 51 | |||
| 52 | This is free software, licensed under: | ||
| 53 | |||
| 54 | The MIT (X11) License | ||
| 55 | |||
| 56 | The full text of the license can be found in the | ||
| 57 | F<LICENSE> file included with this distribution. | ||
| 58 | |||
| 59 | =cut | ||
| 60 | |||
| 61 | __END__ |