Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make -q to silence header, and stdout if specified twice #63575

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print(" -h, --help Display this help message.\n");
OS::get_singleton()->print(" --version Display the version string.\n");
OS::get_singleton()->print(" -v, --verbose Use verbose stdout mode.\n");
OS::get_singleton()->print(" -q, --quiet Quiet mode, silences stdout messages. Errors are still displayed.\n");
OS::get_singleton()->print(" -q, --quiet Be quiet. Silences header if specified once, and all stdout messages if present twice. Errors are still displayed.\n");
OS::get_singleton()->print("\n");

OS::get_singleton()->print("Run options:\n");
Expand Down Expand Up @@ -649,6 +649,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
String debug_uri = "";
bool skip_breakpoints = false;
String main_pack;
bool quiet_header = false;
bool quiet_stdout = false;
int rtm = -1;

Expand Down Expand Up @@ -712,8 +713,12 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph

OS::get_singleton()->_verbose_stdout = true;
} else if (I->get() == "-q" || I->get() == "--quiet") { // quieter output

quiet_stdout = true;
if quiet_header {
abitrolly marked this conversation as resolved.
Show resolved Hide resolved
// the option is specified twice
quiet_stdout = true;
} else {
quiet_header = true;
}

} else if (I->get() == "--audio-driver") { // audio driver

Expand Down Expand Up @@ -1694,7 +1699,9 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
NativeExtensionManager::get_singleton()->initialize_extensions(NativeExtension::INITIALIZATION_LEVEL_SERVERS);

// Print engine name and version
print_line(String(VERSION_NAME) + " v" + get_full_version_string() + " - " + String(VERSION_WEBSITE));
if (!quiet_header) {
print_line(String(VERSION_NAME) + " v" + get_full_version_string() + " - " + String(VERSION_WEBSITE));
}

#if !defined(NO_THREADS)
if (p_main_tid_override) {
Expand Down