groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff-commit] groff/contrib/gdiffmk ChangeLog gdiffmk.man gdi...


From: Werner LEMBERG
Subject: [Groff-commit] groff/contrib/gdiffmk ChangeLog gdiffmk.man gdi...
Date: Mon, 13 Dec 2004 16:16:57 -0500

CVSROOT:        /cvsroot/groff
Module name:    groff
Branch:         
Changes by:     Werner LEMBERG <address@hidden> 04/12/13 20:53:27

Modified files:
        contrib/gdiffmk: ChangeLog gdiffmk.man gdiffmk.sh 

Log message:
        Add `-x' command line option to select a diff program.
        
        * gdiffmk.sh: Add code to handle `-x'.
        Move test for working `diff' down.
        Fix sed pattern.
        (Usage): Updated.
        * gdiffmk.man: Updated.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/gdiffmk/ChangeLog.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/gdiffmk/gdiffmk.man.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/gdiffmk/gdiffmk.sh.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: groff/contrib/gdiffmk/ChangeLog
diff -u groff/contrib/gdiffmk/ChangeLog:1.1 groff/contrib/gdiffmk/ChangeLog:1.2
--- groff/contrib/gdiffmk/ChangeLog:1.1 Sun Dec 12 20:06:55 2004
+++ groff/contrib/gdiffmk/ChangeLog     Mon Dec 13 20:53:26 2004
@@ -1,3 +1,13 @@
+2004-12-13  Mike Bianchi  <address@hidden>
+
+       Add `-x' command line option to select a diff program.
+
+       * gdiffmk.sh: Add code to handle `-x'.
+       Move test for working `diff' down.
+       Fix sed pattern.
+       (Usage): Updated.
+       * gdiffmk.man: Updated.
+
 2004-12-12  Mike Bianchi  <address@hidden>
 
        * README: New file.
Index: groff/contrib/gdiffmk/gdiffmk.man
diff -u groff/contrib/gdiffmk/gdiffmk.man:1.2 
groff/contrib/gdiffmk/gdiffmk.man:1.3
--- groff/contrib/gdiffmk/gdiffmk.man:1.2       Sun Dec 12 14:04:53 2004
+++ groff/contrib/gdiffmk/gdiffmk.man   Mon Dec 13 20:53:26 2004
@@ -43,6 +43,7 @@
 .OP \-a \%addmark
 .OP \-c \%changemark
 .OP \-d \%deletemark
+.OP \-x \%diffcmd
 .OP \-\-
 .OP \-\-help
 .OP \-\-version
@@ -51,6 +52,8 @@
 [
 .I \%output
 ]
+.br
+.ad \na
 .
 .
 .SH DESCRIPTION
@@ -125,6 +128,22 @@
 .BR * .
 .
 .TP
+.BI \-x diffcmd
+Use the
+.I diffcmd
+command to perform the comparison of
+.I file1
+and
+.I file2 .
+In particular,
+.I diffcmd
+should accept the
+.BI \-D name
+option.
+Default:
+.BR diff (1).
+.
+.TP
 .B \-\-
 All the following arguments are treated as file names,
 even if they begin with
@@ -150,13 +169,16 @@
 .LP
 .B gdiffmk
 relies on the
-.B \-D
+.BI \-D name
 option of GNU
 .BR diff (1)
 to make a merged `#ifdef' output format.
 It hasn't been tested whether other versions of
 .BR diff (1)
 do support this option.
+See also the
+.BI \-x diffcmd
+option.
 .
 .LP
 Report bugs to address@hidden
Index: groff/contrib/gdiffmk/gdiffmk.sh
diff -u groff/contrib/gdiffmk/gdiffmk.sh:1.2 
groff/contrib/gdiffmk/gdiffmk.sh:1.3
--- groff/contrib/gdiffmk/gdiffmk.sh:1.2        Sun Dec 12 14:04:53 2004
+++ groff/contrib/gdiffmk/gdiffmk.sh    Mon Dec 13 20:53:26 2004
@@ -23,16 +23,6 @@
 
 cmd=$( basename $0 )
 
-diff -Dx /dev/null /dev/null >/dev/null 2>&1  ||
-       {
-               echo >&2 "${cmd}:  "                            \
-                       "The \`diff' program does not accept "  \
-                       "the required -DNAME option."
-               echo >&2 "${cmd}:  "                            \
-                       "Use GNU diff instead."
-               exit 126
-       }
-
 function Usage {
        if test "$#" -gt 0
        then
@@ -51,12 +41,14 @@
   OUTPUT  Copy of FILE2 with \`.mc' commands added.
           \`-' means standard output (the default).
 
-options:
+OPTIONS:
   -a addmark     Mark for added groff source lines.    Default: +.
   -c changemark  Mark for changed groff source lines.  Default: |.
   -d deletemark  Mark for deleted groff source lines.  Default: *.
-  --version      Print version information on standard output and exit.
-  --help         Print this message on standard error.
+  -x diffcmd     Use a different diff(1) command;
+                 one that accepts the \`-Dname' option, such as GNU diff.
+  --version      Print version information on the standard output and exit.
+  --help         Print this message on the standard error.
 "
        exit 255
 }
@@ -150,19 +142,24 @@
 }
 
 badoption=
-for option
+diffcmd=diff
+for OPTION
 do
-       case "${option}" in
+       case "${OPTION}" in
        -a*)
-               addmark=$( RequiresArgument "${option}" $2 )            &&
+               addmark=$( RequiresArgument "${OPTION}" $2 )            &&
                        shift
                ;;
        -c*)
-               changemark=$( RequiresArgument "${option}" $2 )         &&
+               changemark=$( RequiresArgument "${OPTION}" $2 )         &&
                        shift
                ;;
        -d*)
-               deletemark=$( RequiresArgument "${option}" $2 )         &&
+               deletemark=$( RequiresArgument "${OPTION}" $2 )         &&
+                       shift
+               ;;
+       -x* )
+               diffcmd=$( RequiresArgument "${OPTION}" $2 )            &&
                        shift
                ;;
        --version)
@@ -190,6 +187,11 @@
        shift
 done
 
+${diffcmd} -Dx /dev/null /dev/null >/dev/null 2>&1  ||
+       Usage "The \`${diffcmd}' program does not accept"       \
+               "the required \`-Dname' option.
+Use GNU diff instead.  See the \`-x diffcmd' option."
+
 if test -n "${badoption}"
 then
        Usage "${badoption}"
@@ -246,7 +248,11 @@
                    p
                    d
                  }
-                 /^#endif \/\* not '"${label}"'/ s/.*/.mc '"${deletemark}"'/p
+                 /^#endif \/\* not '"${label}"'/ {
+                  s/.*/.mc '"${deletemark}"'/p
+                  a\
+.mc
+                 }
                  d
                }
                p




reply via email to

[Prev in Thread] Current Thread [Next in Thread]