#! /usr/bin/env perl
our $VERSION = '0.001_02'; # TRIAL VERSION
# PODNAME: cpppp
use strict;
use warnings;
use CodeGen::Cpppp;
use autouse 'Pod::Usage' => 'pod2usage';
use Getopt::Long;


GetOptions(
   '--help' => sub { pod2usage(1) },
) or pod2usage(2);

if (@ARGV) {
   for (@ARGV) {
      open my $fh, '<:utf8', $_ or die "open($_): $!";
      print CodeGen::Cpppp->new()->compile_template($fh, $_)->render;
   }
} else {
   print CodeGen::Cpppp->new()->compile_template(\*STDIN, 'stdin')->render;
}

__END__

=pod

=encoding UTF-8

=head1 NAME

cpppp

=head1 VERSION

version 0.001_02

=head1 USAGE

Transform perl+C source into C

  cpppp [OPTIONS] < file.cp > file.c

=head1 OPTIONS

None yet!  but eventually will support many that C<cpp> has, for defining things and parsing
headers to discover existing types.

=head1 AUTHOR

Michael Conrad <mike@nrdvana.net>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2023 by Michael Conrad.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut
