gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] quiet_5_6.2


From: bump
Subject: [gnugo-devel] quiet_5_6.2
Date: Fri, 23 Apr 2004 09:09:14 -0700

This is a revision of quiet_5_6.1 to suppress the
copyright notices. After that patch there were still
several things that I thought needed to be changed.

(1) Invoking GNU Go from a terminal with no command 
line options defaults to ascii mode. It seemed to
me that the behavior should be identical to
gnugo --mode ascii.

(2) The most visible effect of the quiet option
is to suppress the copyright notice but it also
has other effects in play_gmp.c and play_test.c.
So changing the default global status of quiet
to 1 has side effects that may have been unintended.

(3) In any case it seems simplest just to explicitly
call show_copyright(stderr) when it is wanted, which
is what this revised patch does.

(4) As Gunnar pointed out, the GNU coding standards
ask for the copyright notice to be printed when
--verbose or -v is invoked.

(5) After looking at the GNU coding standards it
seemed that the copyright string could be shortened.

Dan


Index: engine/globals.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/globals.c,v
retrieving revision 1.63
diff -u -r1.63 globals.c
--- engine/globals.c    23 Apr 2004 03:06:36 -0000      1.63
+++ engine/globals.c    23 Apr 2004 15:55:09 -0000
@@ -77,7 +77,7 @@
 
 
 /* Miscellaneous. */
-int quiet             = 1;  /* minimal output */
+int quiet             = 0;  /* minimal output */
 int showstatistics    = 0;  /* print statistics */
 int profile_patterns  = 0;  /* print statistics of pattern usage */
 int allpats           = 0;  /* generate all patterns, even small ones */
Index: interface/main.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/main.c,v
retrieving revision 1.96
diff -u -r1.96 main.c
--- interface/main.c    23 Apr 2004 13:21:53 -0000      1.96
+++ interface/main.c    23 Apr 2004 15:55:09 -0000
@@ -442,7 +442,7 @@
        break;
        
       case OPT_QUIET:
-       quiet = 2;
+       quiet = 1;
        break;
        
       case OPT_GTP_INPUT:
@@ -637,11 +637,8 @@
        break;
 
       case OPT_MODE: 
-       if (strcmp(gg_optarg, "ascii") == 0) {
+       if (strcmp(gg_optarg, "ascii") == 0)
          playmode = MODE_ASCII;
-         if (quiet == 1)
-           quiet = 0;
-       }
        else if (strcmp(gg_optarg, "emacs") == 0)
          playmode = MODE_ASCII_EMACS;
        else if (strcmp(gg_optarg, "gtp") == 0)
@@ -945,6 +942,7 @@
 
       case 'v':
        show_version();
+       show_copyright(stderr);
        return EXIT_SUCCESS;
        break;
        
@@ -993,15 +991,6 @@
       }
     }
 
-
-
-  /* Display copyright message in ASCII mode unless --quiet option used. */
-  if (!quiet) {
-    fprintf(stderr, "\n");
-    show_version();
-    show_copyright(stderr);
-  }
-  
   /* Start random number seed. */
   if (!seed_specified)
     seed = time(0);
@@ -1390,6 +1379,13 @@
     if (mandated_color != EMPTY)
       gameinfo.computer_player = OTHER_COLOR(mandated_color);
 
+  /* Display copyright message in ASCII mode unless --quiet option used. */
+    if (!quiet) {
+      fprintf(stderr, "\n");
+      show_version();
+      show_copyright(stderr);
+    }
+  
     play_ascii(&sgftree, &gameinfo, infilename, untilstring);
     break;
   }
@@ -1408,6 +1404,7 @@
 show_version(void)
 {
   printf("GNU Go Version %s\n", VERSION);
+
 }
 
 
@@ -1497,7 +1494,7 @@
        --byo-period <stones>  Initialize the byo-yomi period.\n\
 \n\
 Informative Output:\n\
-   -v, --version         Display the version of GNU Go\n\
+   -v, --version         Display the version and copyright of GNU Go\n\
    --options             Display configure options\n\
    -h, --help            Display this help message\n\
        --help debug      Display help about debugging options\n\
@@ -1506,24 +1503,14 @@
 "
 
 
-#define COPYRIGHT "\n\n\
-This is GNU Go, a Go program. Contact address@hidden, or see\n\
-http://www.gnu.org/software/gnugo/ for more information.\n\n\
-Copyright 1999, 2000, 2001, 2002, 2003 and 2004\n\
-by the Free Software Foundation.\n\n\
-This program is free software; you can redistribute it and/or\n\
-modify it under the terms of the GNU General Public License\n\
-as published by the Free Software Foundation - version 2.\n\n\
-This program is distributed in the hope that it will be\n\
-useful, but WITHOUT ANY WARRANTY; without even the implied\n\
-warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n\
-PURPOSE.  See the GNU General Public License in file COPYING\n\
-for more details.\n\n\
-You should have received a copy of the GNU General Public\n\
-License along with this program; if not, write to the Free\n\
-Software Foundation, Inc., 59 Temple Place - Suite 330,\n\
-Boston, MA 02111, USA.\n\n\
-"
+#define COPYRIGHT \
+"Copyright 1999, 2000, 2001, 2002, 2003 and 2004 by the Free Software\n\
+Foundation, Inc. See http://www.gnu.org/software/gnugo/ or contact\n\
address@hidden for information about GNU Go. GNU Go comes with NO WARRANTY to\n\
+the extent permitted by law. This program is free software; you can\n\
+redistribute it and/or modify it under the terms of the GNU General Public\n\
+License as published by the Free Software Foundation - version 2.  For more\n\
+information about these matters, see the files named COPYING.\n"
 
 /* USAGE_DEBUG Split in half because of VC limit on constant string 
  * length of 2048 characters!*/




reply via email to

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