From: Thérèse Godefroy Date: Sun, 23 Oct 2016 20:52:54 +0000 (+0200) Subject: Add gnun-add-fuzzy-diff (to be used with po4a-updatepo). X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b75980516d2ca7d8d29000e089c3a1acecbc427c;p=enc.git Add gnun-add-fuzzy-diff (to be used with po4a-updatepo). --- diff --git a/gnun-add-fuzzy-diff b/gnun-add-fuzzy-diff new file mode 100755 index 00000000..212c195f --- /dev/null +++ b/gnun-add-fuzzy-diff @@ -0,0 +1,105 @@ +#! /bin/bash + +# Copyright (C) 2011, 2012, 2013, 2014 Free Software Foundation, Inc. + +# This file is part of GNUnited Nations. + +# GNUnited Nations is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. + +# GNUnited Nations is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with GNUnited Nations. If not, see . + +# Wraps around add-fuzzy-diff to provide a command line interface compliant +# with GNU Coding Standards + +function version () { +cat < +General help using GNU software: +EOF +} + +function single_file_needed () { + echo 1>&2 "$0:" Single FILE argument is required. + exit 1 +} + +in_place= +file= + +while test $# -ge 1; do + case "$1" in + --help | -h ) + usage + exit 0 + ;; + --version | -v ) + version + exit 0 + ;; + -i* | --in-place=* | --in-place ) + in_place="$1" + ;; + -- ) + shift + break + ;; + -* ) + echo 1>&2 "$0:" Invalid option -- \'$1\'. + exit 1 + ;; + * ) + if test "x$file" = x; then + file="$1" + else + single_file_needed + fi + ;; + esac + shift +done + +if test "x$file" = x; then + if test $# -lt 1; then + single_file_needed + else + file="$1" + shift + fi +fi +if test $# -gt 0; then + single_file_needed +fi + +/usr/local/libexec/gnun/add-fuzzy-diff $in_place "$file" + +exit $?