Parse RDP and assistance files in parser.

The command line parser is now populating the settings with
the RDP or assistance file content before parsing the rest
of the arguments.
This commit is contained in:
Armin Novak 2016-03-16 13:15:39 +01:00
parent fb44b6880b
commit fd26624bcb
2 changed files with 6 additions and 16 deletions

View File

@ -195,22 +195,6 @@ int freerdp_client_settings_parse_command_line(rdpSettings* settings, int argc,
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)
return status;

View File

@ -321,6 +321,9 @@ static int freerdp_client_command_line_pre_filter(void* context, int index, int
if (!(settings->ConnectionFile = _strdup(argv[index])))
return COMMAND_LINE_ERROR_MEMORY;
if (freerdp_client_settings_parse_connection_file(settings, settings->ConnectionFile))
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
return 1;
}
}
@ -333,6 +336,9 @@ static int freerdp_client_command_line_pre_filter(void* context, int index, int
if (!(settings->AssistanceFile = _strdup(argv[index])))
return COMMAND_LINE_ERROR_MEMORY;
if (freerdp_client_settings_parse_assistance_file(settings, settings->AssistanceFile) < 0)
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
return 1;
}
}