cp-po: Add --help option, update usage instructions
authorPeter Eisentraut <peter_e@gmx.net>
Sun, 23 Sep 2012 00:41:57 +0000 (20:41 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Sun, 23 Sep 2012 00:41:57 +0000 (20:41 -0400)
cp-po

diff --git a/cp-po b/cp-po
index 25627ae2b971b29f774395933d73717b9c2093d9..e6abb685cd332bf568e115b4cec0f910900bfaa3 100755 (executable)
--- a/cp-po
+++ b/cp-po
@@ -1,10 +1,30 @@
 #!/bin/sh
 
-# Copies PO files from a PgFoundry repository structure to a PostgreSQL
-# source tree.
-#
-# Usage: cp-po [-n] SOURCEDIR DESTDIR
-#
+usage="\
+Copies PO files from a PG messages repository structure to a PostgreSQL
+source tree.
+
+Usage: cp-po [OPTION...] SOURCEDIR DESTDIR
+
+Options:
+  -d        delete files from DESTDIR based on qualified list (-L)
+  -f        copy a PO file even if it has warnings or errors
+  -g        Git mode; combination of -u and make a commit in DESTDIR
+  -k        don't adjust CVS key words of target files; obsolete
+  -L FILE   qualified list; determines which files to copy; together with -d,
+            all files not listed are deleted from DESTDIR
+  -n        dry run
+  -u        update target tree: adjust nls.mk and perform deletes
+
+Typical use for preparing a release:
+  cp-po -L qualified-list-X.Y-branch.txt -g messages postgresql
+  # (add -d before a major release)
+  cd postgresql && git push
+
+Typical use in babel web site scripts:
+  cp-po -f -k messages postgresql
+"
+
 # Written by Peter Eisentraut
 # Public domain
 
@@ -12,6 +32,11 @@ set -e
 
 me=$(basename $0)
 
+if [ "$1" = '--help' ]; then
+    echo "$usage"
+    exit 0
+fi
+
 adjustcvskeywords=true
 force=false
 run=true