#!/usr/local/bin/perl
use strict;
use warnings;
use Astro::App::Satpass2;
use Getopt::Long 2.33;
use Pod::Usage;
our $VERSION = '0.031';
my %opt;
GetOptions(\%opt,
qw{gmt location=s},
help => sub { pod2usage( { -verbose => 2 } ) },
) or pod2usage( { -verbose => 1 } );
my @args = ('-filter');
my $time = join ' ', map {
(my $s = $_) =~ s/([\\'])/\\$1/g; $s} @ARGV;
$opt{location} and push @args, $opt{location};
push @args, 'location', 'echo', "almanac '$time'", 'echo',
"quarters '$time'", 'exit';
Astro::App::Satpass2->run(@args);
__END__
=head1 TITLE
almanac - Calculate today's almanac
=head1 SYNOPSIS
almanac
almanac tomorrow
almanac -gmt
almanac -help
=head1 OPTIONS
=over
=item -gmt
This option causes the time to be output in GMT.
=item -help
This option displays this documentation, then exits.
=item -location name
This option executes the named macro before generating the almanac. As
the name implies, the macro is assumed to set the location, but in
reality it can do anything.
=back
=head1 DETAILS
This Perl script uses the L<Astro::App::Satpass2|Astro::App::Satpass2>
object to generate an almanac. It assumes the presence of an
initialization file that sets the position. The date of the almanac can
be passed as an argument; otherwise the current date is used.
=head1 AUTHOR
Thomas R. Wyant, III F<wyant at cpan dot org>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2010-2016 by Thomas R. Wyant, III
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl 5.10.0. For more details, see the full text
of the licenses in the directory LICENSES.
This program is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of
merchantability or fitness for a particular purpose.
=cut
# ex: set textwidth=72 :