[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Unnecessary bash-specific function declarations in gdiffmk
From: |
Colin Watson |
Subject: |
[PATCH] Unnecessary bash-specific function declarations in gdiffmk |
Date: |
Tue, 22 Sep 2009 09:58:28 +0100 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
gdiffmk unnecessarily uses a function declaration syntax that only works
with bash. The changes necessary to make it work with other POSIX shells
as well (dash is now Debian's default /bin/sh) are trivial, and follow.
=== modified file 'contrib/gdiffmk/gdiffmk.sh'
--- contrib/gdiffmk/gdiffmk.sh 2009-01-05 20:10:29 +0000
+++ contrib/gdiffmk/gdiffmk.sh 2009-09-22 08:57:42 +0000
@@ -21,7 +21,7 @@
cmd=$( basename $0 )
-function Usage {
+Usage () {
if test "$#" -gt 0
then
echo >&2 "${cmd}: $@"
@@ -60,7 +60,7 @@ OPTIONS:
}
-function Exit {
+Exit () {
exitcode=$1
shift
for arg
@@ -75,7 +75,7 @@ function Exit {
#
# Check for existence and readability of given file name.
# If not found or not readable, print message and exit with EXIT_CODE.
-function FileRead {
+FileRead () {
case "$2" in
-)
return
@@ -97,7 +97,7 @@ function FileRead {
#
# Create the given filename if it doesn't exist.
# If unable to create or write, print message and exit with EXIT_CODE.
-function FileCreate {
+FileCreate () {
case "$2" in
-)
return
@@ -115,7 +115,7 @@ function FileCreate {
fi
}
-function WouldClobber {
+WouldClobber () {
case "$2" in
-)
return
@@ -136,7 +136,7 @@ DELETEMARK='*'
MARK1='[['
MARK2=']]'
-function RequiresArgument {
+RequiresArgument () {
# Process flags that take either concatenated or
# separated values.
case "$1" in
Thanks,
--
Colin Watson address@hidden
- [PATCH] Unnecessary bash-specific function declarations in gdiffmk,
Colin Watson <=