summaryrefslogtreecommitdiff
path: root/scripts/rev-update
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/rev-update
parentd56828fc75b8d7f69b76f6679d71fb092d258a80 (diff)
downloadinstallation-guide-241e6b700f49d8570e7936a037a1adc403b6fb97.zip
Add command-line usage information.
Diffstat (limited to 'scripts/rev-update')
-rwxr-xr-xscripts/rev-update34
1 files changed, 22 insertions, 12 deletions
diff --git a/scripts/rev-update b/scripts/rev-update
index 8d1d16f8b..3c3a2dd73 100755
--- a/scripts/rev-update
+++ b/scripts/rev-update
@@ -1,27 +1,34 @@
#!/usr/bin/perl -w
-
+#
# This script converts and updates revision comments in translations.
# It will automatically replace revision comments for 'original documents'
# with revision comments for 'translated documents'.
-# When called with "-u" option, it will also update the revision for the
-# translated document to the revision number in the original document.
# This script only supports SVN style revision marks.
-
-# Note: only use the "-u" option after you have made sure there are no
-# changes in content for the listed documents.
-
-# SYNOPSIS:
-# ./rev-update [-u] [-v] [lang]
#
-# (uses $lang set below if lang is not given on commandline)
use Getopt::Std;
use File::Find;
-$opt_u = $opt_v = 0;
-getopts('uvV');
+$opt_h = $opt_u = $opt_v = 0;
+getopts('huv');
# You may set this to your default language code
$lang = shift || "pl";
+sub usage
+{
+ printf <<HERE, $lang;
+Usage: $0 [options] [<language>]
+
+ -h print this help message.
+ -u update the revision for the translated document to the revision
+ number in the original document (use only after having made sure
+ there are no changes in content for the listed documents).
+ -v be verbose.
+
+ Current <language> is '%s'.
+HERE
+ exit 0;
+}
+
sub convert
{
my ($plfname, $plrev) = (@_);
@@ -129,6 +136,9 @@ sub process
$plfname =~ s,^en/,$lang/,;
checkrev($plfname, $enfname);
}
+
+usage() if $opt_h;
+
File::Find::find({ wanted => \&process, no_chdir => 1 }, 'en');
#checkrev("build/install.$lang.xml", "build/install.en.xml");
#checkdiff("release-notes.$lang.sgml","release-notes.sgml");