- // Additional custom non-UCI commands, mainly for debugging.
- // Do not use these commands during a search!
- else if (token == "flip") pos.flip();
- else if (token == "bench") bench(pos, is, states);
- else if (token == "d") sync_cout << pos << sync_endl;
- else if (token == "eval") sync_cout << Eval::trace(pos) << sync_endl;
- else
- sync_cout << "Unknown command: " << cmd << sync_endl;
-
- } while (token != "quit" && argc == 1); // Command line args are one-shot
+ // Add custom non-UCI commands, mainly for debugging purposes.
+ // These commands must not be used during a search!
+ else if (token == "flip") pos.flip();
+ else if (token == "bench") bench(pos, is, states);
+ else if (token == "d") sync_cout << pos << sync_endl;
+ else if (token == "eval") trace_eval(pos);
+ else if (token == "compiler") sync_cout << compiler_info() << sync_endl;
+ else if (token == "export_net")
+ {
+ std::optional<std::string> filename;
+ std::string f;
+ if (is >> skipws >> f)
+ filename = f;
+ Eval::NNUE::save_eval(filename);
+ }
+ else if (token == "--help" || token == "help" || token == "--license" || token == "license")
+ sync_cout << "\nStockfish is a powerful chess engine for playing and analyzing."
+ "\nIt is released as free software licensed under the GNU GPLv3 License."
+ "\nStockfish is normally used with a graphical user interface (GUI) and implements"
+ "\nthe Universal Chess Interface (UCI) protocol to communicate with a GUI, an API, etc."
+ "\nFor any further information, visit https://github.com/official-stockfish/Stockfish#readme"
+ "\nor read the corresponding README.md and Copying.txt files distributed along with this program.\n" << sync_endl;
+ else if (!token.empty() && token[0] != '#')
+ sync_cout << "Unknown command: '" << cmd << "'. Type help for more information." << sync_endl;
+
+ } while (token != "quit" && argc == 1); // The command-line arguments are one-shot