1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
#!/bin/sh
outputfile=
outputdir=
domain=messages
spliteq() {
arg=$1
echo "${arg#*=}"
#alternatives echo "$arg" | cut -d= -f2-
# or echo "$arg" | sed 's/[^=]*=//'
}
syntax() {
printf "%s\n" "Usage: xgettext [OPTION] [INPUTFILE]..."
exit 1
}
show_version() {
printf "%s\n", "these are not (GNU gettext-tools) 99.9999.9999\n"
exit 0
}
while true ; do
case $1 in
#--files-from=*) readfile `spliteq "$1"`;;
#-f) expectfilefrom=1;;
--version) show_version;;
-V) show_version;;
--default-domain=*) domain=`spliteq "$1"` ;;
-d) shift ; domain="$1" ;;
--files-from=*) : ;;
-f) shift ;;
--directory=*) : ;;
-D) shift ;;
-o) shift ; outputfile="$1" ;;
--output=*) outputfile=`spliteq "$1"` ;;
--output-dir=*) outputdir=`spliteq "$1"` ;;
-p) shift ; outputdir=`spliteq "$1"` ;;
--language=*) : ;;
-L) shift ;;
--C) : ;;
--c++) : ;;
--from-code=*) : ;;
--join-existing) : ;;
-j) : ;;
--exclude-file=*) : ;;
-x) shift;;
--add-comments=*) : ;;
-cTAG) shift;;
--add-comments) : ;;
-c) : ;;
--extract-all) : ;;
-a) : ;;
--keyword=*) : ;;
-k*) : ;;
--keyword) : ;;
-k) : ;;
--flag=*) : ;;
--trigraphs) : ;;
-T) : ;;
--qt) : ;;
--kde) : ;;
--boost) : ;;
--debug) : ;;
--color) : ;;
--color=*) : ;;
--style=*) : ;;
--no-escape) : ;;
-e) : ;;
--escape) : ;;
-E) : ;;
--force-po) force=1 ;;
--indent) : ;;
-i) : ;;
--no-location) : ;;
--add-location) : ;;
-n) : ;;
--strict) : ;;
--properties-output) : ;;
--stringtable-output) : ;;
--width=*) : ;;
-w) : ;;
--no-wrap) : ;;
--sort-output) : ;;
-s) : ;;
--sort-by-file) : ;;
-F) : ;;
--omit-header) : ;;
--copyright-holder=*) : ;;
--foreign-user) : ;;
--package-name=*) : ;;
--package-version=*) : ;;
--msgid-bugs-address=*) : ;;
--msgstr-prefix*) : ;;
-m*) : ;;
--msgstr-suffix*) : ;;
-M*) : ;;
--help) syntax ;;
-h) syntax ;;
*) break ;;
esac
shift
done
[ "$outputfile" = "-" ] && exit 0
[ -z "$outputdir" ] && outputdir=.
[ -z "$outputfile" ] && outputfile=${domain}.po
touch $outputdir/$outputfile
|