diff --git a/client/src/proxmark3.c b/client/src/proxmark3.c index 60f3b5be8..427619e75 100644 --- a/client/src/proxmark3.c +++ b/client/src/proxmark3.c @@ -691,6 +691,7 @@ int main(int argc, char *argv[]) { bool flash_mode = false; bool flash_can_write_bl = false; + bool debug_mode_forced = false; int flash_num_files = 0; char *flash_filenames[FLASH_MAX_FILES]; @@ -698,16 +699,6 @@ int main(int argc, char *argv[]) { set_my_executable_path(); set_my_user_directory(); -#ifdef USE_PREFERENCE_FILE - // Load Settings and assign - // This will allow the command line to override the settings.json values - preferences_load(); - // quick patch for debug level - g_debugMode = session.client_debug_level; - // settings_save (); - // End Settings -#endif - for (int i = 1; i < argc; i++) { if (argv[i][0] != '-') { @@ -779,6 +770,7 @@ int main(int argc, char *argv[]) { return 1; } g_debugMode = demod; + debug_mode_forced = true; i++; continue; } @@ -886,6 +878,17 @@ int main(int argc, char *argv[]) { return 1; } +#ifdef USE_PREFERENCE_FILE + // Load Settings and assign + // This will allow the command line to override the settings.json values + preferences_load(); + // quick patch for debug level + if (! debug_mode_forced) + g_debugMode = session.client_debug_level; + // settings_save (); + // End Settings +#endif + #ifndef USE_PREFERENCE_FILE // comment next 2 lines to use session values set from settings_load session.supports_colors = DetectWindowsAnsiSupport();