2#include <freerdp/config.h>
3#include <freerdp/client/cmdline.h>
4#include "../xf_cmdline.h"
5#include "../xfreerdp.h"
7int main(
int argc,
char* argv[])
16 } cases[] = { {
nullptr, FALSE, TRUE },
17 {
"/defer-alt", TRUE, TRUE },
18 {
"+defer-alt", TRUE, TRUE },
19 {
"-defer-alt", FALSE, TRUE },
20 {
"/defer-alt:invalid", FALSE, FALSE },
21 {
"/kbd:defer-alt", FALSE, FALSE } };
23 for (
size_t i = 0; i < ARRAYSIZE(cases); i++)
25 xfContext xfc = WINPR_C_ARRAY_INIT;
29 xfc.common.context.settings = settings;
32 char* args[] = {
"xfreerdp",
"/v:localhost", cases[i].option,
nullptr };
33 const int count = cases[i].option ? ARRAYSIZE(args) - 1 : ARRAYSIZE(args) - 2;
34 const int status = xf_client_settings_parse_command_line(&xfc, count, args);
35 const BOOL passed = ((status == 0) == cases[i].valid) &&
36 (!cases[i].valid || (xfc.deferAlt == cases[i].enabled));
40 (void)fprintf(stderr,
"option %s: status %d, enabled %d\n",
41 cases[i].option ? cases[i].option :
"(default)", status, xfc.deferAlt);
50 char* args[] = {
"freerdp",
"/v:localhost",
"/defer-alt",
nullptr };
51 const int status = freerdp_client_settings_parse_command_line_arguments(
52 settings, ARRAYSIZE(args) - 1, args, FALSE);
54 return status < 0 ? 0 : 1;
FREERDP_API rdpSettings * freerdp_settings_new(DWORD flags)
creates a new setting struct
FREERDP_API void freerdp_settings_free(rdpSettings *settings)
Free a settings struct with all data in it.