status = freerdp_client_settings_parse_command_line_arguments(settings, argc, argv, allowUnknown);
if (settings->ConnectionFile)
- {
status = freerdp_client_settings_parse_connection_file(settings, settings->ConnectionFile);
- }
if (settings->AssistanceFile)
- {
status = freerdp_client_settings_parse_assistance_file(settings, settings->AssistanceFile);
- }
+
+ if (status < 0)
+ return status;
+
+ /* In case settings have been populated from a RDP or assistance file
+ * reparse the command line to give priotiry to command line for concurring settings.
+ */
+ if (settings->ConnectionFile || settings->AssistanceFile)
+ status = freerdp_client_settings_parse_command_line_arguments(settings, argc, argv, allowUnknown);
/* Only call post processing if no status/error was returned*/
if (status < 0)