From 454ae722a89d8be4f62045bd023bdbaf915b41a9 Mon Sep 17 00:00:00 2001 From: Peter Gadfort Date: Tue, 15 Oct 2024 17:15:05 -0400 Subject: [PATCH] ord: add -no_settings flag to control gui settings Signed-off-by: Peter Gadfort --- src/Main.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Main.cc b/src/Main.cc index 4eb97a437b6..a39358599c7 100644 --- a/src/Main.cc +++ b/src/Main.cc @@ -117,7 +117,7 @@ int cmd_argc; char** cmd_argv; const char* log_filename = nullptr; const char* metrics_filename = nullptr; -bool no_init = false; +bool no_settings = false; static const char* init_filename = ".openroad"; @@ -258,7 +258,7 @@ int main(int argc, char* argv[]) remove(metrics_filename); } - no_init = findCmdLineFlag(argc, argv, "-no_init"); + no_settings = findCmdLineFlag(argc, argv, "-no_settings"); cmd_argc = argc; cmd_argv = argv; @@ -277,7 +277,7 @@ int main(int argc, char* argv[]) logger->warn(utl::ORD, 38, "-gui is not yet supported with -python"); } - if (!no_init) { + if (!findCmdLineFlag(cmd_argc, cmd_argv, "-no_init")) { logger->warn(utl::ORD, 39, ".openroad ignored with -python"); } @@ -353,7 +353,7 @@ static int tclAppInit(int& argc, ; } - gui::startGui(argc, argv, interp, "", true, !no_init); + gui::startGui(argc, argv, interp, "", true, !no_settings); } else { // init tcl if (Tcl_Init(interp) == TCL_ERROR) { @@ -402,7 +402,7 @@ static int tclAppInit(int& argc, const bool gui_enabled = gui::Gui::enabled(); const char* home = getenv("HOME"); - if (!no_init && home) { + if (!findCmdLineFlag(argc, argv, "-no_init") && home) { const char* restore_state_cmd = "source -echo -verbose {{{}}}"; #ifdef USE_STD_FILESYSTEM std::filesystem::path init(home); @@ -476,7 +476,7 @@ static void showUsage(const char* prog, const char* init_filename) { printf("Usage: %s [-help] [-version] [-no_init] [-no_splash] [-exit] ", prog); printf("[-gui] [-threads count|max] [-log file_name] [-metrics file_name] "); - printf("cmd_file\n"); + printf("[-no_settings] cmd_file\n"); printf(" -help show help and exit\n"); printf(" -version show version and exit\n"); printf(" -no_init do not read %s init file\n", init_filename); @@ -484,6 +484,7 @@ static void showUsage(const char* prog, const char* init_filename) printf(" -no_splash do not show the license splash at startup\n"); printf(" -exit exit after reading cmd_file\n"); printf(" -gui start in gui mode\n"); + printf(" -no_settings do not load the previous gui settings\n"); #ifdef ENABLE_PYTHON3 printf( " -python start with python interpreter [limited to db "