chiark / gitweb /
add kvm-img wrapper script
[bin.git] / rosetta-merge-all
1 #! /bin/sh
2
3 APPLY=false
4
5 usage () {
6         [ "$1" = 0 ] || exec >&2
7         echo "Usage: $0 [--apply] [--keep-old] [--prefix PREFIX] SOURCE"
8         exit "$1"
9 }
10
11 die_getopt () {
12         echo "getopt failed" >&2
13         exit 1
14 }
15
16 parse_opts () {
17         eval set -- "$(getopt -o '' -l apply,keep-old,prefix:,help -- "$@")"
18         while :; do
19                 case $1 in
20                         --apply)
21                                 APPLY=:
22                                 shift
23                                 ;;
24                         --keep-old)
25                                 shift
26                                 ;;
27                         --prefix)
28                                 shift 2
29                                 ;;
30                         --help)
31                                 usage 0
32                                 shift
33                                 ;;
34                         --)     shift; break ;;
35                         *)      die_getopt ;;
36                 esac
37         done
38 }
39
40 [ "$1" ] || usage 1
41
42 parse_opts "$@"
43
44 if $APPLY; then
45         for x in *.po; do rosetta-merge "$@" ${x%.*}; done
46 else
47         for x in *.po; do rosetta-merge "$@" ${x%.*} | view -; done
48 fi