#! /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
}
ADD_FUZZY_DIFF=./add-fuzzy-diff
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
$ADD_FUZZY_DIFF $in_place "$file"
exit $?