From 6989cd4d40cb45c0fdc5124697f130dc8d125580 Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Wed, 7 Jun 2023 17:50:01 +0200 Subject: [PATCH] Fix command line vimix Commit 0f7d42ab83dd9bdf137d7b145b0fc0cfd36eabff broke the --clean option. --- src/main.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 1ed2e7a..5716490 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -61,15 +61,6 @@ int main(int argc, char *argv[]) { std::string _openfile; - /// - /// Settings - /// - Settings::Load(); - Settings::application.executable = std::string(argv[0]); - - /// lock to inform an instance is running - Settings::Lock(); - // one extra argument is given if (argc == 2) { std::string argument(argv[1]); @@ -110,11 +101,22 @@ int main(int argc, char *argv[]) else { // try to open the file _openfile = argument; - Settings::application.fresh_start = false; - fprintf(stderr, "Loading %s %s\n", argv[0], _openfile.c_str()); } } + /// + /// Settings + /// + Settings::Load(); + Settings::application.executable = std::string(argv[0]); + + /// lock to inform an instance is running + Settings::Lock(); + + if (!_openfile.empty()) { + Settings::application.fresh_start = false; + fprintf(stderr, "Loading %s\n", _openfile.c_str()); + } /// /// CONNECTION INIT