aboutsummaryrefslogtreecommitdiffstats
path: root/copypage.pl
diff options
context:
space:
mode:
authorJavier Fernandez-Sanguino Peña <jfs>2010-10-16 12:05:51 +0000
committerJavier Fernandez-Sanguino Peña <jfs>2010-10-16 12:05:51 +0000
commit9693277b8b9d03fa96b88bf7965aae0e21a26d58 (patch)
tree4907ca7860d06223c6cf5600a687e51d1cfc5565 /copypage.pl
parenta3098ce345c5e1beb53533362ef7177bebed6b13 (diff)
Allow language and maintainer to be set in the command line and document the use of environment variables
CVS version numbers copypage.pl: 1.36 -> 1.37
Diffstat (limited to 'copypage.pl')
-rwxr-xr-xcopypage.pl25
1 files changed, 21 insertions, 4 deletions
diff --git a/copypage.pl b/copypage.pl
index eb5ee2c1485..12cb6086bd6 100755
--- a/copypage.pl
+++ b/copypage.pl
@@ -61,6 +61,16 @@ if (exists $ENV{DWWW_MAINT})
$maintainer = $ENV{DWWW_MAINT};
}
+# Values overwritten by commandline
+if (defined $opt_m)
+{
+ $maintainer = $opt_m;
+}
+if (defined $opt_l)
+{
+ $language = $opt_l;
+}
+
die "Language not defined in DWWW_LANG or language.conf\n"
if not defined $language;
@@ -71,7 +81,7 @@ die "Language not defined in DWWW_LANG or language.conf\n"
# Check usage.
if ($#ARGV == -1)
{
- print "Usage: $0 [-n] page ...\n\n";
+ print "Usage: $0 [-n] [-m maintainer] page ...\n\n";
print "Copies the page from the english/ directory to the $language/ directory\n";
print "and adds the translation-check header with the current revision,\n";
print "optionally adds also the maintainer name.\n";
@@ -81,14 +91,21 @@ if ($#ARGV == -1)
print "If the file already exists in the $language/ repository either\n";
print "because it was removed (and is in the Attic) or has been removed\n";
print "locally the program will abort and warn the user (unless '-n' is used)\n";
+ print "Environment variables:\n";
+ print "\tDWWW_LANG\tSets the language for the translation\n";
+ print "\t\t(overwrites language.conf definition\n";
+ print "\tDWWW_MAINT\tSets maintainer for the translation\n";
print "Options:\n";
print "\t-n\tDoes not check status of target files in CVS\n";
- exit;
+ print "\t-m\tSets the maintainer for the translation (overwrites environment)\n";
+ print "\t-l\tSets the language for the translation (overwrites environment)\n";
+ print "\n";
+
}
# Options
-our ($opt_n);
-getopts('n');
+our ($opt_n, $opt_t, $opt_l);
+getopts('nm:l:');
# Table of entities used when copying to non-latin1 encodings
@entities = (

© 2014-2024 Faster IT GmbH | imprint | privacy policy