#!perl

use v5.12;
use strict;
use warnings;

use Acme::ConspiracyTheory::Random qw( theory bad_punctuation );

my $count   = 1;
my $divider = '';
my $bad     = 0;

foreach ( @ARGV ) {
	if ( /--space-?comma/ ) {
		$bad = 1;
	}
	elsif ( /^([0-9]+)$/ ) {
		$count = $1;
		$divider = ( $count > 1 ) ? "\n" : "";
	}
	else {
		warn "Unknown argument: $_\n";
	}
}

say bad_punctuation( theory(), !$bad ) . $divider
	for 1 .. $count;


__END__

=pod

=encoding utf-8

=head1 NAME

conspire - drops some truth

=head1 DESCRIPTION

B<< conspire >> will print a conspiracy theory to STDOUT.

B<< conspire 3 >> will print three conspiracy theories.
(Other positive integers also work.)

=head1 BUGS

Please report any bugs to
L<https://github.com/tobyink/p5-acme-conspiracytheory-random/issues>.

=head1 SEE ALSO

L<Acme::ConspiracyTheory::Random>.

=head1 AUTHOR

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

=head1 COPYRIGHT AND LICENCE

This software is copyright (c) 2021 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.