#!/usr/bin/env perl

use 5.008;
use strict;
use warnings;
use utf8;

use Crypt::XkcdPassword;
use Getopt::Long;

my $words  = "EN";
my $length = 4;

GetOptions(
	'words|w=s'     => \$words,
	'length|l=i'    => \$length,
);

print Crypt::XkcdPassword->new(words => $words)->make_password($length), $/;

__END__

=pod

=encoding utf-8

=head1 NAME

passphrase - quickly generate an XKCD-style passphrase

=head1 SYNOPSIS

 passphrase --length=4 --words=EN

=head1 DESCRIPTION

Prints a passphrase to STDOUT.

=over

=item C<< -l N >>, C<< --length=N >>

The length of the phrase (in words, not characters).

Defaults to 4.

=item C<< -w CLASS >>, C<< --words=CLASS >>

The Perl class that will be used as a dictionary. Whatever string you
specify will be prefixed with C<< Crypt::XkcdPassword::Words:: >>.
Case-sensitive.

Defaults to C<< EN >>.

=back

=head1 BUGS

Please report any bugs to
L<http://rt.cpan.org/Dist/Display.html?Queue=Crypt-XkcdPassword>.

=head1 AUTHOR

Toby Inkster E<lt>tobyink@cpan.orgE<gt>.

=head1 COPYRIGHT AND LICENCE

This software is copyright (c) 2014 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=head1 DISCLAIMER OF WARRANTIES

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

