From 7119abd14346553d14a8abf7ba3fe62f8fab747d Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 9 Mar 2011 17:45:54 +0100 Subject: fix help message Signed-off-by: Florian Pritz --- generate_gallery.pl | 52 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/generate_gallery.pl b/generate_gallery.pl index f79c433..a5f3c8b 100755 --- a/generate_gallery.pl +++ b/generate_gallery.pl @@ -7,19 +7,17 @@ use File::MimeInfo qw(mimetype); use Image::Magick; use Getopt::Long; use Module::Load; - -if (@ARGV == 0) { - print "usage: ".basename($0)." ...\n"; - exit 0; -} +use Pod::Usage; my $templatedir = abs_path(dirname($0))."/generate_gallery.d"; my $startdir = cwd(); my %opts = (); -GetOptions(\%opts, "exif|e", "verbose|v", "help|h"); +GetOptions(\%opts, "exif|e", "verbose|v", "help|h") or pod2usage(2); +pod2usage(0) if $opts{help}; +pod2usage(-verbose => 0) if (@ARGV== 0); if ($opts{exif}) { load Image::ExifTool, "ImageInfo"; @@ -72,3 +70,45 @@ for my $dir (@ARGV) { close OUTPUT; system "cp", "-r", "$templatedir/fancybox", "."; } +__END__ + +=head1 NAME + +generate_gallery.pl - Generate simple, static HTML gallery + +=head1 SYNOPSIS + +generate_gallery.pl [options] + + Options: + --help, -h short help message + --verbose, -v be verbose during operation + --exif, -e add exif information of each image to the page + +=head1 OPTIONS + +=over 8 + +=item B<--help>, B<-h> + +Print a short help message. + +=item B<--verbose>, B<-v> + +Be verbose. + +=item B<--exif>, B<-e> + +Add the following exif information to the page: +shutter speed, ISO, focal length, aperture + +This is only recomended for pictures taken with digital cameras. + +=back + +=head1 DESCRIPTION + +This program will generate thumbnails for all images in the given directores and +create a static HTML gallery page. + +=cut -- cgit v1.2.3-24-g4f1b