From 2aeeb9e448dfd23625a04b661de6a2199c4029f1 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Tue, 9 Nov 2021 11:30:15 +0100 Subject: [PATCH] temple -e --- temple | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/temple b/temple index f745433..b1301a6 100755 --- a/temple +++ b/temple @@ -10,14 +10,18 @@ use Getopt::Long; use UCW::Temple; my $out; +my @execs = (); -GetOptions('out|o=s' => \$out) or die "Usage: temple [-o ] ..."; +GetOptions('out|o=s' => \$out, 'exec|e=s' => \@execs) or die "Usage: temple [-o ] [-e ] ..."; if (defined $out) { close STDOUT; - open STDOUT, ">$out" or die "Cannot open $out: $!"; + open STDOUT, '>:utf8', $out or die "Cannot open $out: $!"; } if (!@ARGV) { push @ARGV, "-"; } UCW::Temple::start(); +foreach (@execs) { + UCW::Temple::parse_string($_, "-e"); +} foreach (@ARGV) { UCW::Temple::parse_file($_); } -- 2.39.5