summaryrefslogtreecommitdiffstats
path: root/util/dofile.pl
diff options
context:
space:
mode:
Diffstat (limited to 'util/dofile.pl')
-rw-r--r--util/dofile.pl16
1 files changed, 16 insertions, 0 deletions
diff --git a/util/dofile.pl b/util/dofile.pl
index a6b0905a58..780759b97c 100644
--- a/util/dofile.pl
+++ b/util/dofile.pl
@@ -8,6 +8,8 @@
use strict;
use warnings;
+use Getopt::Std;
+
# Because we know that Text::Template isn't a core Perl module, we use
# a fallback in case it's not installed on the system
use File::Basename;
@@ -74,6 +76,19 @@ sub broken {
undef;
}
+# Check options ######################################################
+
+my %opts = ();
+
+# -o ORIGINATOR
+# declares ORIGINATOR as the originating script.
+getopt('o', \%opts);
+
+my @autowarntext = ("WARNING: do not edit!",
+ "Generated"
+ . (defined($opts{o}) ? " by ".$opts{o} : "")
+ . (scalar(@ARGV) > 0 ? " from ".join(", ",@ARGV) : ""));
+
# Template reading ###################################################
# Read in all the templates into $text, while keeping track of each
@@ -100,6 +115,7 @@ $template->fill_in(OUTPUT => \*STDOUT,
HASH => { config => \%config,
target => \%target,
withargs => \%withargs,
+ autowarntext => \@autowarntext,
quotify1 => \&quotify1,
quotify_l => \&quotify_l },
DELIMITERS => [ "{-", "-}" ],