Package: debian-installer
Version: r41137
Author: Guillem Jover <guillem@debian.org>
Status: applied
Description:
 Add command-line usage information.

Index: doc-check
===================================================================
--- doc-check	(revision 41137)
+++ doc-check	(revision 41138)
@@ -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 @@
 	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 @@
 	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;
Index: cp-untrans
===================================================================
--- cp-untrans	(revision 41137)
+++ cp-untrans	(revision 41138)
@@ -11,13 +11,19 @@
 
 set -e
 
+language=${1:-pl}
+
 if [ "$1" = "--help" ]; then
-    echo "Usage: $0 language"
+    echo <<HELP
+Usage: $0 [<language>]
+
+  --help    print this help message.
+
+Current <language> is '$language'.
+HELP
     exit 0
 fi
 
-language=${1:-pl}
-
 UFILES="$(./scripts/doc-check $language 2>/dev/null | \
             egrep "^en\/.* \(untranslated\)$" | \
             cut -d" " -f1 | cut -d"/" -f2- )"
Index: rev-update
===================================================================
--- rev-update	(revision 41137)
+++ rev-update	(revision 41138)
@@ -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 @@
 	$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");
