# $PREFIX/share/sh-scripts or $PREFIX/share/gettext. In order to not violate
# the Filesystem Hierarchy Standard when doing so, this script is executable.
# Therefore it needs to support the standard --help and --version.
-case "$0" in
- gettext.sh | */gettext.sh | *\gettext.sh)
- progname=$0
- package=@PACKAGE@
- version=@VERSION@
- # func_usage
- # outputs to stdout the --help usage message.
- func_usage ()
- {
- echo "GNU gettext shell script function library version $version"
- echo "Usage: . gettext.sh"
- }
- # func_version
- # outputs to stdout the --version message.
- func_version ()
- {
- echo "$progname (GNU $package) $version"
- echo "Copyright (C) 2003-2005 Free Software Foundation, Inc.
+if test -z "$ZSH_VERSION"; then
+ # zsh is not POSIX compliant: By default, while ". gettext.sh" is executed,
+ # it sets $0 to "gettext.sh", defeating the purpose of this test. But
+ # fortunately we know that when running under zsh, this script is always
+ # being sourced, not executed, because hardly anyone is crazy enough to
+ # install zsh as /bin/sh.
+ case "$0" in
+ gettext.sh | */gettext.sh | *\gettext.sh)
+ progname=$0
+ package=@PACKAGE@
+ version=@VERSION@
+ # func_usage
+ # outputs to stdout the --help usage message.
+ func_usage ()
+ {
+ echo "GNU gettext shell script function library version $version"
+ echo "Usage: . gettext.sh"
+ }
+ # func_version
+ # outputs to stdout the --version message.
+ func_version ()
+ {
+ echo "$progname (GNU $package) $version"
+ echo "Copyright (C) 2003-2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
- echo "Written by" "Bruno Haible"
- }
- if test $# = 1; then
- case "$1" in
- --help | --hel | --he | --h )
- func_usage; exit 0 ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v )
- func_version; exit 0 ;;
- esac
- fi
- func_usage 1>&2
- exit 1
- ;;
-esac
+ echo "Written by" "Bruno Haible"
+ }
+ if test $# = 1; then
+ case "$1" in
+ --help | --hel | --he | --h )
+ func_usage; exit 0 ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v )
+ func_version; exit 0 ;;
+ esac
+ fi
+ func_usage 1>&2
+ exit 1
+ ;;
+ esac
+fi
# eval_gettext MSGID
# looks up the translation of MSGID and substitutes shell variables in the