=head1 NAME

serge-test-parser - Test parser against any given file

=head1 SYNOPSIS

C<< serge test-parser E<lt>parser_nameE<gt> E<lt>file_pathE<gt> [--import-mode]
[--output-mode=E<lt>modeE<gt>] [--data-file=E<lt>file_pathE<gt>] >>

Where C<E<lt>parser_nameE<gt>> is a class name of the parser, and C<E<lt>file_pathE<gt>>
is a path to the localizable file to test this parser on.

Note that you can omit the C<< Serge::Engine::Plugin:: >> prefix of the parser class name
if your parser is located in lib/Serge/Engine/Plugin folder. Consider the following examples of C<E<lt>parser_nameE<gt>> parameter:

=over 8

=item B<parse_android>

Use C<< Serge::Engine::Plugin::parse_android >> parser class.

=item B<Serge::Engine::Plugin::parse_android>

Same as above (explicit class declaration).

=item B<ACME::Parser>

Use C<< ACME::Parser >> parser class.

=back

=head1 DESCRIPTION

Parse the given file using the selected parser and emit the resulting data
in one of the available formats. This is useful for writing new parsers.

=head1 OPTIONS

=over 8

=item B<--import-mode>

With this option, parser will be told it works in import mode. In such mode
import-aware parsers are expected to extract translations rather than source strings,
and also skip missing translations.

=item B<--output-mode=E<lt>modeE<gt>>

By default, parsed data will be emitted in an easily readable Config::Neat format
(the format used in Serge configuration files). Such files are also suitable for diff.
However, there are alternative output modes available:

=over 8

=item B<dumper>

Use Data::Dumper to dump the parsed structure. The format is a bit verbose, but can be handy
for debugging.

=back

=item B<--as-objects>

By default, parsed data is rendered as an array of arrays; each inner array holds fields
in the following order: string, context, hint, flagsref, lang, key. With --as-objects,
the data will be rendered as an array of objects with corresponding key names
for better readability.

=item B<--data-file=E<lt>file_pathE<gt>>

Some parsers require configuration data. You can pass data structure to the parser
using this parameter. Target file should be a configuration file in Config::Neat format
with the parser data that you would usually put into C<< jobs E<gt> ... E<gt> parser E<gt>
data >> section of Serge configuration file.

=back

=head1 SEE ALSO

Part of L<serge> suite.
