diff options
author | Guillem Jover <guillem@debian.org> | 2006-09-30 16:57:12 +0000 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2006-09-30 16:57:12 +0000 |
commit | 241e6b700f49d8570e7936a037a1adc403b6fb97 (patch) | |
tree | 85ff326fb9663d6b3a1117d9a56e5544df9fc990 /scripts | |
parent | d56828fc75b8d7f69b76f6679d71fb092d258a80 (diff) | |
download | installation-guide-241e6b700f49d8570e7936a037a1adc403b6fb97.zip |
Add command-line usage information.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/cp-untrans | 12 | ||||
-rwxr-xr-x | scripts/doc-check | 37 | ||||
-rwxr-xr-x | scripts/rev-update | 34 |
3 files changed, 54 insertions, 29 deletions
diff --git a/scripts/cp-untrans b/scripts/cp-untrans index a41356097..199db8640 100755 --- a/scripts/cp-untrans +++ b/scripts/cp-untrans @@ -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- )" 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; 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"); |