#!/usr/bin/perl

use v5.14;
use warnings;

use App::podman;

use Getopt::Long;

GetOptions(
   'format|f=s' => \my $FORMAT,
) or exit 1;

exit App::podman->new->run(
   shift @ARGV,
   format => $FORMAT,
);

=head1 NAME

F<podman> - a terminal-based structured document viewer for POD and other formats

=head1 SYNOPSIS

   $ podman my-document.pod

   # Understands POD in .pm files
   $ podman lib/App/podman.pm

   # Search perldoc for page documentation
   podman Scalar::Util

   $ Understands Markdown files
   podman README.md

=head1 DESCRIPTION

This script runs the L<App::podman> program, which renders a structured
document to a terminal output, via the F<less> pager.

=head1 ARGUMENTS

   $ podman [FILE]

=head2 FILE

If a file path is given, the filename is used to determine if it should be
parsed as POD (F<*.pm> or F<*.pod>), or Markdown (F<*.md>). (But see also the
C<-f> option).

If the name is not a file, C<perldoc -l> will be used to convert the name of
a Perl module into a location for its documentation.

=head1 OPTIONS

=head2 -f, --format FORMAT

Overrides detection of the file's format by inspecting the filename. Useful
for viewing POD out of toplevel scripts whose filename does not indicate a
language:

   $ podman -f POD bin/podman

=head1 AUTHOR

Paul Evans <leonerd@leonerd.org.uk>

=cut
