minor test-edits to en/index.html
[enc.git] / gnun-add-fuzzy-diff
CommitLineData
b7598051
TG
1#! /bin/bash
2
3# Copyright (C) 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
4
5# This file is part of GNUnited Nations.
6
7# GNUnited Nations is free software: you can redistribute it and/or
8# modify it under the terms of the GNU General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11
12# GNUnited Nations is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16
17# You should have received a copy of the GNU General Public License
18# along with GNUnited Nations. If not, see <http://www.gnu.org/licenses/>.
19
20# Wraps around add-fuzzy-diff to provide a command line interface compliant
21# with GNU Coding Standards
22
23function version () {
24cat <<EOF
25gnun-add-fuzzy-diff (GNUnited Nations) 0.10
26Copyright (C) 2014 Free Software Foundation, Inc.
27You may redistribute copies of GNUnited Nations
28under the terms of the GNU General Public License.
29For more information about these matters, see the file named COPYING.
30EOF
31}
32
33function usage () {
34cat <<EOF
35Usage: gnun-add-fuzzy-diff [OPTION...] [FILE]
36Add comments with differences to previous msgids to fuzzy translations
37in a PO file.
38
39Options:
40 -i[SUFFIX], --in-place[=SUFFIX]
41 Edit files in place (makes backup if extension supplied)
42 -v, --version Display version info and exit
43 -h, --help Display this help and exit
44
45Report bugs to bug-gnun@gnu.org
46GNUnited Nations home page: <https://www.gnu.org/software/gnun/>
47General help using GNU software: <http://www.gnu.org/gethelp/>
48EOF
49}
50
51function single_file_needed () {
52 echo 1>&2 "$0:" Single FILE argument is required.
53 exit 1
54}
55
56in_place=
57file=
58
59while test $# -ge 1; do
60 case "$1" in
61 --help | -h )
62 usage
63 exit 0
64 ;;
65 --version | -v )
66 version
67 exit 0
68 ;;
69 -i* | --in-place=* | --in-place )
70 in_place="$1"
71 ;;
72 -- )
73 shift
74 break
75 ;;
76 -* )
77 echo 1>&2 "$0:" Invalid option -- \'$1\'.
78 exit 1
79 ;;
80 * )
81 if test "x$file" = x; then
82 file="$1"
83 else
84 single_file_needed
85 fi
86 ;;
87 esac
88 shift
89done
90
91if test "x$file" = x; then
92 if test $# -lt 1; then
93 single_file_needed
94 else
95 file="$1"
96 shift
97 fi
98fi
99if test $# -gt 0; then
100 single_file_needed
101fi
102
103/usr/local/libexec/gnun/add-fuzzy-diff $in_place "$file"
104
105exit $?