App-podispell

 view release on metacpan or  search on metacpan

bin/podispell  view on Meta::CPAN

          next WORD;
        }
      }
      $pos += $line_offset + $line_length;
    }

    close $in;
    close $out;
    kill 2, $pid;

    return $source;
  }
}

{
  use Getopt::Long qw(:config gnu_getopt no_auto_abbrev no_ignore_case);

  GetOptions(
    'd|dictionary=s@' => \(my $dictionary),
    'b|backup'        => \(my $backup),
    'h|help'          => sub {
      require Pod::Usage;
      Pod::Usage::pod2usage(-exitval => 0, -verbose => 1);
    },
    'V|version'      => sub {
      print "podispell version $Pod::SpellChecker::VERSION\n";
      exit 0;
    },
  ) or exit 1;

  my $speller = Pod::SpellChecker->new(
    ($dictionary ? ( dictionary => $dictionary ) : ()),
    ($backup     ? ( backup     => $backup     ) : ()),
  );

  if (!@ARGV) {
    die "no files specified!\n";
  }

  for my $file (@ARGV) {
    $speller->check_file($file);
  }
}

__END__

=for stopwords
podispell ispell haarg Knop cpan HAARG perl

=head1 NAME

podispell - Interactive Pod spell checker

=head1 SYNOPSIS

  podispell [ -d <dictionary> ] [ -b ] lib/My/Library.pm lib/My/SecondLibrary.pm

=head1 DESCRIPTION

This is an interactive Pod spell checker, modeled after the ispell interface.
It will prompt for corrections on any spelling mistakes it finds, and overwrite
the original file when complete.

Requires C<hunspell>.

=head1 OPTIONS

=over 4

=item C<-d> C<--dictionary>

Sets the dictionary to use.  Defaults to 'C<en_US>'.  Can be specified multiple
times.

=item C<-b> C<--backup>

Keep backup files.  A copy of the file will be saved with a C<.bak> extension
before being modified.

=item C<-h> C<--help>

Display this help text.

=item C<-V> C<--version>

Display the version number.

=back

=head1 AUTHOR

haarg - Graham Knop (cpan:HAARG) <haarg@haarg.org>

=head1 CONTRIBUTORS

None yet.

=head1 COPYRIGHT

Copyright (c) 2015-2015 the podispell L</AUTHOR> and L</CONTRIBUTORS>
as listed above.

=head1 LICENSE

This library is free software and may be distributed under the same terms
as perl itself. See L<http://dev.perl.org/licenses/>.

=cut



( run in 0.503 second using v1.01-cache-2.11-cpan-0b5f733616e )