Skip to content

Commit

Permalink
ord: add -no_settings flag to control gui settings
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Gadfort <[email protected]>
  • Loading branch information
gadfort committed Oct 15, 2024
1 parent ebbccd3 commit 454ae72
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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;
Expand All @@ -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");
}

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -476,14 +476,15 @@ 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);
printf(" -threads count|max use count threads\n");
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 "
Expand Down

0 comments on commit 454ae72

Please sign in to comment.