#!/usr/bin/perl use strict; use warnings; use Getopt::Long; use File::Basename; use File::Spec::Functions; my $libdir = catfile("[% PREFIX %]","lib","jspell"); my ($exists, $listall, $dicdir); my $result = GetOptions("list-dics" => \$listall, "dic-dir" => \$dicdir, "installed=s" => \$exists); my @dics = map { basename($_) } <$libdir/*hash>; if ($dicdir) { print "$libdir\n"; } elsif ($listall) { if (@dics) { print(map "$_\n", @dics); } } elsif ($exists) { if (grep {$_ eq "$exists.hash"} @dics) { print "yes\n"; } else { print "no\n"; exit(1); } } else { print " jspell-dict [--list-dics] | [--dic-dir] | [--installed=]\n"; } =head1 NAME jspell-dict - Command line tool to manage Jspell dictionaries =head1 SYNOPSIS jspell-dict --list-dics jspell-dict --dir jspell-dict --installed =head1 DESCRIPTION This is a simple interface to manage Jspell dictionaries. Main flags are used to: =over 4 =item C<--list-dics> List installed dictionaries =item C<--dic-dir> Shows the directory where dictionaries should be installed =item C<--installed=EdictE> Returns a boolean value (for the operating system) stating if some dictionary is installed. =back =head1 SEE ALSO jspell(1), jbuild(1), Lingua::Jspell(3) and perl(1) =head1 AUTHOR Alberto Manuel Brandão Simões, Eambs@cpan.orgE =head1 COPYRIGHT AND LICENSE Copyright (C) 2007-2008 by Projecto Natura =cut