gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] PATCH: GTP command reference extraction


From: Thien-Thi Nguyen
Subject: [gnugo-devel] PATCH: GTP command reference extraction
Date: Wed, 08 Sep 2004 15:23:46 +0200

greetings GNU Go programmers,

please find below a tiny patch against the 3.3.15 distribution that
improves (IMHO) the GTP command reference extraction methodology and
output appearance.  here is a suitable ChangeLog entry:

2004-08-11  Thien-Thi Nguyen  <address@hidden>  (tiny change)

        * gtp.texi (GTP command reference): Add @cindex.

        * gtp-commands.sed: Use @verbatim. Tighten output.
        Move `Function' field into @item line, sans field name.

        * Makefile.am (gtp-commands.texi):
        Eliminate redundant use of cat(1).

i used "diff -u"; let me know if you would prefer "diff -c" or some
other format.

happy hacking,
thi


for f in gtp.texi gtp-commands.sed Makefile.am ; do diff -u $f $f.NEW ; done
--- gtp.texi    Tue Nov 12 05:50:47 2002
+++ gtp.texi.NEW        Wed Aug 11 18:31:21 2004
@@ -359,6 +359,7 @@
 
 @node GTP command reference, , Regression with GTP, GTP
 @section GTP command reference
address@hidden GTP command reference
 
 This section lists the GTP command set along with some information about each
 command.  Each entry in the list has the following fields:
--- gtp-commands.sed    Tue Nov 12 05:50:47 2002
+++ gtp-commands.sed.NEW        Wed Aug 11 18:31:14 2004
@@ -13,31 +13,30 @@
 # Hold comment lines, deleting them from pattern space for now.
 /.\*/{
  s/^..//
+ s/^ //
  H
  d
 }
 
 # When we see the function name, merge hold space, in the process
-# generating proper texinfo @cindex, @item and @example formatting.
+# generating proper texinfo @cindex, @item and @verbatim formatting.
+# As a bonus, the `Function' field is moved to the @item line.
 # We use repeated `x' commands instead of the simpler `i' to avoid
 # requiring a `d' (which would render this script non-composable).
 /^gtp_/{
- s/^\(.*\)$/@cindex \1\
address@hidden \1\
-\
address@hidden/
- G
- x
- s/.*/\
address@hidden example\
-/
- x
- G
+ s/\(.*\)/@cindex \1\
address@hidden \1/
  x
+ s/^\(.\)Function: *\(.*\)\(Arguments:\)/: address@hidden/
+ s/\
+ *\(address@hidden)/ \1/g
+ s/$/\
address@hidden verbatim/
+ H
  s/.*//
  x
+ s/\
+//2
 }
 
 # gtp-commands.sed ends here
-
-
--- Makefile.am Sat Nov 16 01:50:05 2002
+++ Makefile.am.NEW     Wed Aug 11 18:32:08 2004
@@ -36,10 +36,10 @@
 cmdsrc = $(srcdir)/../interface/play_gtp.c
 
 gtp-commands.texi: $(cmdsrc)
-       cat $(srcdir)/gtp-commands.sed > TMP.sed
-       sed -e '/static struct gtp_command commands/,/^}/!d'            \
+       sed -e '1r '$(srcdir)/gtp-commands.sed                          \
+           -e '/static struct gtp_command commands/,/^}/!d'            \
            -e '/^ /!d' -e '/NULL/d'                                    \
            -e 's/ *{"\(.*\)"[^a-z]*\(gtp_[a-z_]*\)}.*/s,\2,\1,g/'      \
-           $(cmdsrc) >> TMP.sed
+           $(cmdsrc) > TMP.sed
        sed -f TMP.sed $(cmdsrc) > $(srcdir)/gtp-commands.texi
        rm -f TMP.sed






reply via email to

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