diff options
author | Anatoli Babenia <anatoli@rainforce.org> | 2023-07-07 20:07:09 +0300 |
---|---|---|
committer | Anatoli Babenia <anatoli@rainforce.org> | 2024-02-15 14:10:11 +0300 |
commit | e25cfffc7f038246e276c1aa29660dcc2d87685f (patch) | |
tree | b7b728d13e39d2e5f020cc9d49462335ee6b8c16 /main | |
parent | 907db8eebcecb97d527edcaff77a1c87a6c068f5 (diff) | |
download | redot-engine-e25cfffc7f038246e276c1aa29660dcc2d87685f.tar.gz |
Add `--no-header` option to clean output
* Do not print empty line when header is disabled
* Do not print Vulcan header
* Also add "Print header" project setting (default On)
(suggested by @kaissouDev)
* Add docs for the project setting
(with suggestions by @Mickeon and @akien-mga)
Co-authored-by: Micky <66727710+Mickeon@users.noreply.github.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/main/main.cpp b/main/main.cpp index ceb2cbbae7..4c9c159f47 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -483,6 +483,7 @@ void Main::print_help(const char *p_binary) { print_help_option("--version", "Display the version string.\n"); print_help_option("-v, --verbose", "Use verbose stdout mode.\n"); print_help_option("--quiet", "Quiet mode, silences stdout messages. Errors are still displayed.\n"); + print_help_option("--no-header", "Do not print engine version and rendering method header on startup.\n"); print_help_title("Run options"); print_help_option("--, ++", "Separator for user-provided arguments. Following arguments are not used by the engine, but can be read from `OS.get_cmdline_user_args()`.\n"); @@ -1013,6 +1014,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph quiet_stdout = true; + } else if (I->get() == "--no-header") { + Engine::get_singleton()->_print_header = false; + } else if (I->get() == "--audio-driver") { // audio driver if (I->next()) { @@ -1833,6 +1837,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph if (bool(GLOBAL_GET("application/run/disable_stderr"))) { CoreGlobals::print_error_enabled = false; } + if (!bool(GLOBAL_GET("application/run/print_header"))) { + // --no-header option for project settings. + Engine::get_singleton()->_print_header = false; + } if (quiet_stdout) { CoreGlobals::print_line_enabled = false; @@ -2449,7 +2457,7 @@ Error Main::setup2() { set_current_thread_safe_for_nodes(true); // Print engine name and version - print_line(String(VERSION_NAME) + " v" + get_full_version_string() + " - " + String(VERSION_WEBSITE)); + Engine::get_singleton()->print_header(String(VERSION_NAME) + " v" + get_full_version_string() + " - " + String(VERSION_WEBSITE)); #ifdef TOOLS_ENABLED if (editor || project_manager || cmdline_tool) { @@ -2742,8 +2750,6 @@ Error Main::setup2() { AudioDriverManager::initialize(audio_driver_idx); - print_line(" "); // Add a blank line for readability. - // Right moment to create and initialize the audio server. audio_server = memnew(AudioServer); audio_server->init(); @@ -2763,6 +2769,9 @@ Error Main::setup2() { OS::get_singleton()->benchmark_end_measure("Startup", "Servers"); + // Add a blank line for readability. + Engine::get_singleton()->print_header(""); + register_core_singletons(); /* Initialize the main window and boot screen */ |