Perl x Open Food Facts Hackathon: Paris, France - May 24-25 Learn more

#!/usr/bin/env perl
use strict;
our $VERSION = 0.06;
# Run.
exit App::PYX2XML->new->run;
# Print version.
sub VERSION_MESSAGE {
print $VERSION."\n";
exit 0;
}
__END__
=pod
=encoding utf8
=head1 NAME
pod2xml - Script to convert PYX to XML.
=head1 SYNOPSIS
pyx2xml [-e in_enc] [-h] [-i] [-s no_simple] [--version] [filename] [-]
=head1 DESCRIPTION
pyx2xml script uses PYX::SGML::Tags class to create XML output of PYX.
=head1 ARGUMENTS
=over 8
=item * C<-e in_enc>
Input encoding.
Default value is 'utf-8'.
=item * C<-h>
Print help.
=item * C<-i>
Indent output.
=item * C<-s no_simple>
List of element, which cannot be a simple like <element/>.
Separator is comma.
=item * C<--version>
Print version of script.
=item * C<filename>
Input file in PYX format.
=item * C<->
Stdin with PYX input.
=back
=head1 EXAMPLE1
pyx2xml
# Output:
# Usage: pyx2xml [-e in_enc] [-h] [-i] [--version] [filename] [-]
# -e in_enc Input encoding (default value is utf-8).
# -h Print help.
# -i Indent output.
# --version Print version.
# [filename] Process on filename
# [-] Process on stdin
=head1 EXAMPLE2
cat <<END | pyx2xml -
(element
-foo
)element
END
# Output:
# <element>foo</element>
=head1 EXAMPLE3
cat <<END | pyx2xml -s foo,baz -
(foo
)foo
(bar
)bar
(baz
)baz
END
# Output:
# <foo></foo><bar /><baz></baz>
=head1 REPOSITORY
=head1 AUTHOR
Michal Josef Špaček L<mailto:skim@cpan.org>
=head1 LICENSE AND COPYRIGHT
© 2015-2021 Michal Josef Špaček
BSD 2-Clause License
=head1 VERSION
0.06
=cut