]> mj.ucw.cz Git - temple.git/blob - temple
f74543329a26d46a5b81e5e0cbc8f4d536a3f942
[temple.git] / temple
1 #!/usr/bin/perl -CSA
2 # A really simple template engine
3 # (c) 2004 Martin Mares <mj@ucw.cz>
4
5 use strict;
6 use warnings;
7 use lib '.';
8
9 use Getopt::Long;
10 use UCW::Temple;
11
12 my $out;
13
14 GetOptions('out|o=s' => \$out) or die "Usage: temple [-o <out>] <in> ...";
15 if (defined $out) {
16         close STDOUT;
17         open STDOUT, ">$out" or die "Cannot open $out: $!";
18 }
19 if (!@ARGV) { push @ARGV, "-"; }
20 UCW::Temple::start();
21 foreach (@ARGV) {
22         UCW::Temple::parse_file($_);
23 }
24 UCW::Temple::finish();