#!/usr/bin/perl -w

# include perl packages
use strict;
use warnings;
use diagnostics;

use File::Basename;


my $nr = @ARGV;

if ($nr < 1) {
  print "Error: $0 called with just $nr arguments\n";
  usage();
  exit();
}


my $dir = $ARGV[0];
if (-d $dir) {
  print "Error: first argument ($dir) is a valid directory.\nThis Mapivi Plug-In is developed for Mapivi version >= 0.7.5\n";
  usage();
  exit();
}

for (0 .. ($nr-1)) {
  print "picture $_: $ARGV[$_]\n";
}

exit();

##############################################################
# usage
##############################################################
sub usage {
  my $prog = basename($0);
  print "\nUsage: $prog file1 [file2] [file3] [...]\n\n";
  print "This is a test plugin for mapivi (see http://mapivi.de.vu)\n";
  print "It will just print out the files received from mapivi\n";
  print "Author:  Martin Herrmann <martin-herrmann\@gmx.de>\n";
  print "License: GNU General Public License, version 2\n";
}


# Tell Emacs that this is really a perl script
# Local Variables:
# mode:perl
# End:
