summaryrefslogtreecommitdiff
path: root/scripts/doc-check
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2006-09-30 16:57:12 +0000
committerGuillem Jover <guillem@debian.org>2006-09-30 16:57:12 +0000
commit241e6b700f49d8570e7936a037a1adc403b6fb97 (patch)
tree85ff326fb9663d6b3a1117d9a56e5544df9fc990 /scripts/doc-check
parentd56828fc75b8d7f69b76f6679d71fb092d258a80 (diff)
downloadinstallation-guide-241e6b700f49d8570e7936a037a1adc403b6fb97.zip
Add command-line usage information.
Diffstat (limited to 'scripts/doc-check')
-rwxr-xr-xscripts/doc-check37
1 files changed, 23 insertions, 14 deletions
diff --git a/scripts/doc-check b/scripts/doc-check
index 01501e2ce..aac4e0470 100755
--- a/scripts/doc-check
+++ b/scripts/doc-check
@@ -1,23 +1,12 @@
#!/usr/bin/perl -w
-
+#
# This script checks if the translations of the documents are up to date.
-# When called with "-d" option, it also prints what has changed in the
-# original since last translation.
-# If the "-r" option is used with the "-d" option, the diff will be taken
-# against the revision number specified with the -r option instead of
-# the latest revision of the English original.
-# When called with "-s" option, it also shows all files that are marked
-# untranslated.
-
-# SYNOPSIS:
-# ./doc-check [-d] [-r <revision>] [-s] [-v] [-V] [lang]
#
-# (uses $lang set below if lang is not given on commandline)
use Getopt::Std;
use File::Find;
-$opt_d = $opt_r = $opt_s = $opt_v = $opt_V = 0;
-getopts('r:dsvV');
+$opt_d = $opt_h = $opt_r = $opt_s = $opt_v = $opt_V = 0;
+getopts('hr:dsvV');
# You may set this to your default language code
$lang = shift || "pl";
if ($opt_r and $opt_r !~ /[0-9]+/) {
@@ -25,6 +14,24 @@ if ($opt_r and $opt_r !~ /[0-9]+/) {
exit 1
}
+sub usage
+{
+ printf <<HERE, $lang;
+Usage: $0 [options] [<language>]
+
+ -h print this help message.
+ -d print what has changed in the original since last translation.
+ -r <rev> take the diff against the revision number <rev> instead of the
+ latest revision of the English original.
+ -s show also all files marked untranslated.
+ -v be verbose.
+ -V be slightly more verbose.
+
+ Current <language> is '%s'.
+HERE
+ exit 0;
+}
+
sub checkdiff
{
my ($plfname, $enfname) = (@_);
@@ -123,6 +130,8 @@ sub process_obsolete
close FILE;
}
+usage() if $opt_h;
+
warn "\nChecking for outdated or missing translations...\n" if $opt_v;
File::Find::find({ wanted => \&process, no_chdir => 1 }, 'en');
warn "\nChecking for obsoleted translations...\n" if $opt_v;