File: flickr_dump_stored_config.pl

package info (click to toggle)
libflickr-api-perl 1.29-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 464 kB
  • sloc: perl: 1,471; makefile: 22
file content (109 lines) | stat: -rwxr-xr-x 2,060 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/usr/bin/env perl

#-----------------------------
# flickr_dump_stored_config.pl
#_____________________________

use warnings;
use strict;
use Data::Dumper;
use Storable  qw(store_fd retrieve_fd);
use Getopt::Long;
use Pod::Usage;

my $config;
my $cli_args = {};

GetOptions (
			$cli_args,
			'config_in=s',
			'help',
			'man',
			'usage'
		   );


if (defined($ARGV[0])) { $cli_args->{'config_in'} = $ARGV[0]; }


#-------------------------------------------------------------
# Respond to help-type arguments or if missing required params
#_____________________________________________________________

if ($cli_args->{'help'} or $cli_args->{'usage'}  or $cli_args->{'man'} or !$cli_args->{'config_in'}) {

        pod2usage({ -verbose => 2 });

}



open my $CFG, "<", $cli_args->{'config_in'}
  or die "Failed to open  $cli_args->{'config_in'}: $!";

$config = retrieve_fd($CFG);

close $CFG;

$Data::Dumper::Sortkeys=1;

print "\n\n\n\nRetrieved\n\n",Dumper($config),"\nfrom ",$cli_args->{'config_in'}," using Storable\n\n";

exit;

__END__

=pod

=head1 NAME

flickr_dump_stored_config - script to display contents of a Flickr::API
storable configuration file.

=head1 SYNOPSIS

  flickr_dump_stored_config [/path/to/file or --config_in=Config-File_to_dump]

=head1 OPTIONS

=head2 Required:

=over 5

=item Either a B</path/to/config/file> or

=item B<--config_in> pointing to the stored Flickr config file.

=back

=over 5

=item  B<--help> as expected

=item  B<--usage>

=item  B<--man>

=back

=head1 DESCRIPTION

This script is a lightweight way to dump the contents of a
Flickr::API storable configuration. It does not I<use Flickr::API;> 
and sticks to modules from perl core so that it can be used 
prior to --and perhaps in conjunction with-- installation
and testing of the Flickr::API module.



=head1 LICENSE AND COPYRIGHT

Copyright (c) 2015-2016, Louis B. Moore C<< <lbmoore@cpan.org> >>.

This program is released under the Artistic License 2.0 by The Perl Foundation.


=head1 SEE ALSO

The README in the Flickr::API distribution.