From bfd8b730be2e332954df37a62e9a63e429e064cc Mon Sep 17 00:00:00 2001 From: Hans Fredrik Nordhaug Date: Sun, 3 Jan 2021 10:17:07 +0100 Subject: Updated copypage.pl usage and removed errors / warnings when it is run without arguments. Also removed remaining code for and info about the "-n" option that was removed in May 2018. --- copypage.pl | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'copypage.pl') diff --git a/copypage.pl b/copypage.pl index 88dd0295981..bc83c5413eb 100755 --- a/copypage.pl +++ b/copypage.pl @@ -43,7 +43,9 @@ if (open CONF, "new(); # Options -our ($opt_n, $opt_t, $opt_l); -getopts('nm:l:'); +our ($opt_t, $opt_l); +getopts('m:l:'); # Values overwritten by commandline if (defined $opt_m) @@ -75,28 +77,31 @@ if (defined $opt_l) # Check usage. if ($#ARGV == -1) { - print "Usage: $0 [-n] [-l language] [-m maintainer] page ...\n\n"; + + $language = "" if not defined $language; + + print "Usage: $0 [-l language] [-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"; print "If the directory does not exist, it will be created, and the Makefile\n"; - print "copied or created, depending on the setting of your language.conf file.\n\n"; + print "copied or created, depending on the setting of your language.conf file.\n"; + print "If the file already exists in the $language/ directory\n"; + print "the file will be skipped and the user warned.\n\n"; print "The 'english/' part of the input path is optional.\n\n"; - 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 "Environment variables (which overwrites language.conf):\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-m\tSets the maintainer for the translation (overwrites environment)\n"; - print "\t-l\tSets the language for the translation (overwrites environment)\n"; + print "\t-m\tSets the maintainer for the translation (overwrites everything)\n"; + print "\t-l\tSets the language for the translation (overwrites everything)\n"; print "\n"; + # Exit immediately as there is nothing to do. + exit } -die "Language not defined in DWWW_LANG or language.conf\n" +die "Language not defined in language.conf, DWWW_LANG or command-line switch\n" if not defined $language; #warn "Maintainer name not defined in DWWW_MAINT or language.conf\n" -- cgit v1.2.3