version 1.4w10UCIb18
[polyglot.git] / main.cpp
index b46be4a..83f1019 100644 (file)
--- a/main.cpp
+++ b/main.cpp
 // constants\r
 \r
 \r
-static const char * const Version = "1.4W10UCIb17";\r
+static const char * const Version = "1.4W10UCIb18";\r
 static const char * const HelpMessage = "\\r
 SYNTAX\n\\r
-polyglot [configfile]\n\\r
-polyglot make-book [-pgn inputfile] [-bin outputfile] [-max-ply ply] [-min-game games] [-min-score score] [-only-white] [-only-black] [-uniform]\n\\r
-polyglot merge-book -in1 inputfile1 -in2 inputfile2 [-out outputfile]\n\\r
-polyglot [configfile] epd-test [-epd inputfile] [-min-depth depth] [-max-depth depth] [-max-time time] [-depth-delta delta]\n\\r
-polyglot perft [-fen fen] [-max-depth depth]\\r
+* polyglot [configfile]\n\\r
+* polyglot -ec enginecommand\n\\r
+* polyglot make-book [-pgn inputfile] [-bin outputfile] [-max-ply ply] [-min-game games] [-min-score score] [-only-white] [-only-black] [-uniform]\n\\r
+* polyglot merge-book -in1 inputfile1 -in2 inputfile2 [-out outputfile]\n\\r
+* polyglot info-book [-bin inputfile] [-exact]\n\\r
+* polyglot dumb-book [-bin inputfile] -color color [-out outputfile]\n\\r
+* polyglot [configfile] epd-test [-epd inputfile] [-min-depth depth] [-max-depth depth] [-max-time time] [-depth-delta delta]\n\\r
+* polyglot perft [-fen fen] [-max-depth depth]\\r
 ";\r
 \r
 static const int SearchDepth = 63;\r
@@ -59,7 +62,6 @@ static void parse_option ();
 static void init_book ();\r
 static bool parse_line   (char line[], char * * name_ptr, char * * value_ptr);\r
 static void stop_search  ();\r
-static void sig_quit(int);\r
 \r
 // functions\r
 \r
@@ -101,6 +103,21 @@ int main(int argc, char * argv[]) {
         book_merge(argc,argv);\r
         return EXIT_SUCCESS;\r
     }\r
+\r
+       if (argc >= 2 && my_string_equal(argv[1],"merge-book")) {\r
+      book_merge(argc,argv);\r
+      return EXIT_SUCCESS;\r
+   }\r
+\r
+   if (argc >= 2 && my_string_equal(argv[1],"dump-book")) {\r
+      book_dump(argc,argv);\r
+      return EXIT_SUCCESS;\r
+   }\r
+\r
+   if (argc >= 2 && my_string_equal(argv[1],"info-book")) {\r
+      book_info(argc,argv);\r
+      return EXIT_SUCCESS;\r
+   }\r
     \r
     if (argc >= 2 && my_string_equal(argv[1],"perft")) {\r
         do_perft(argc,argv);\r
@@ -185,7 +202,6 @@ void polyglot_set_option(char *name, char *value){ // this must be cleaned up!
 // init_book()\r
 \r
 static void init_book(){\r
-    const char *empty_var[]={};\r
     book_clear();\r
     if (option_get_bool("Book")){\r
         my_log("POLYGLOT *** SETTING BOOK ***\n");\r
@@ -221,8 +237,6 @@ static void parse_option() {
            my_fatal("parse_option(): missing [Engine] section\n");\r
        }\r
        \r
-       if(line[0]=='#') continue;\r
-       \r
        if (my_string_case_equal(line,"[engine]")) break;\r
        \r
        if (parse_line(line,&name,&value)) {\r
@@ -249,8 +263,6 @@ static void parse_option() {
    Init = true;\r
    while (my_file_read_line(file,line,256)) {\r
        if (line[0] == '[') my_fatal("parse_option(): unknown section %s\n",line);\r
-       if (line[0]=='#') continue;\r
-       \r
        if (parse_line(line,&name,&value)) {\r
            uci_send_option(Uci,name,"%s",value);\r
                //to get a decent display in winboard_x we need to now if an engine really is doing multipv analysis\r