|| (arg->Flags & COMMAND_LINE_VALUE_OPTIONAL))
{
BOOL overlong = FALSE;
+
printf(" %s", "/");
if (arg->Format)
{
size_t length = (strlen(arg->Name) + strlen(arg->Format) + 2);
-
if (arg->Flags & COMMAND_LINE_VALUE_OPTIONAL)
length += 2;
printf("Multimedia Redirection: /multimedia:sys:alsa\n");
printf("USB Device Redirection: /usb:id,dev:054c:0268\n");
printf("\n");
+
printf("For Gateways, the https_proxy environment variable is respected:\n");
#ifdef _WIN32
printf(" set HTTPS_PROXY=http://proxy.contoso.com:3128/\n");
#endif
printf(" xfreerdp /g:rdp.contoso.com ...\n");
printf("\n");
+
printf("More documentation is coming, in the meantime consult source files\n");
printf("\n");
return TRUE;
if (!(settings->ConnectionFile = _strdup(argv[index])))
return COMMAND_LINE_ERROR_MEMORY;
+
return 1;
}
}
if (!(settings->AssistanceFile = _strdup(argv[index])))
return COMMAND_LINE_ERROR_MEMORY;
+
return 1;
}
}
if ((errno != 0) || (val <= 0) || (val > UINT16_MAX))
return FALSE;
-
*host = (char*) calloc(length + 1UL, sizeof(char));
if (!(*host))
if (arg->Flags & COMMAND_LINE_VALUE_PRESENT)
{
- int i;
+ DWORD i;
RDP_KEYBOARD_LAYOUT* layouts;
layouts = freerdp_keyboard_get_layouts(RDP_KEYBOARD_LAYOUT_TYPE_STANDARD);
//if (!layouts) /* FIXME*/
return strncmp(&str[strLen - extLen], ext, extLen) == 0;
}
-
int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
int argc, char** argv, BOOL allowUnknown)
{
}
else
{
+
if (allowUnknown)
{
flags |= COMMAND_LINE_IGN_UNKNOWN_KEYWORD;
if ((errno != 0) || (val == 0) || (val > UINT16_MAX))
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
-
length = (int)(p - arg->Value);
settings->ServerPort = val;
settings->PercentScreenUseWidth = 1;
partial = TRUE;
}
-
if (strchr(p, 'h'))
{
settings->PercentScreenUseHeight = 1;
}
CommandLineSwitchCase(arg, "kbd")
{
- unsigned long id;
- char* pEnd;
- id = strtoul(arg->Value, &pEnd, 16);
-
- if (pEnd != (arg->Value + strlen(arg->Value)))
- id = 0;
+ unsigned long id = strtoul(arg->Value, NULL, 0);
- if (id == 0)
+ if ((errno != 0) || (id > UINT32_MAX) || (id == 0))
{
const int rc = freerdp_map_keyboard_layout_name_to_id(arg->Value);
- if (rc < 0)
- WLog_ERR(TAG, "A problem occurred while mapping the layout name to id");
- else if (rc == 0)
+ if (rc <= 0)
{
WLog_ERR(TAG, "Could not identify keyboard layout: %s", arg->Value);
WLog_ERR(TAG, "Use /kbd-list to list available layouts");
+ return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
}
- if (rc <= 0)
- return COMMAND_LINE_STATUS_PRINT;
-
- id = rc;
+ /* Found a valid mapping, reset errno */
+ id = (unsigned long)rc;
+ errno = 0;
}
settings->KeyboardLayout = (UINT32) id;
if ((errno != 0) || (val == 0) || (val > UINT16_MAX))
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
-
length = (int)(p - arg->Value);
settings->GatewayPort = val;
long type;
char* pEnd;
type = strtol(arg->Value, &pEnd, 10);
-
if (errno != 0)
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
long type;
char* pEnd;
type = strtol(arg->Value, &pEnd, 10);
-
if (errno != 0)
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
if (arg->Value)
{
#ifdef WITH_GFX_H264
-
if (_strnicmp("AVC444", arg->Value, 6) == 0)
{
settings->GfxH264 = TRUE;
CommandLineSwitchCase(arg, "gfx-thin-client")
{
settings->GfxThinClient = arg->Value ? TRUE : FALSE;
-
if (settings->GfxThinClient)
settings->GfxSmallCache = TRUE;
-
settings->SupportGraphicsPipeline = TRUE;
}
CommandLineSwitchCase(arg, "gfx-small-cache")
if ((errno != 0) || (val > UINT32_MAX))
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
-
settings->SendPreconnectionPdu = TRUE;
settings->PreconnectionId = val;
}
{
settings->NSCodec = TRUE;
}
-
#if defined(WITH_JPEG)
else if (strcmp(arg->Value, "jpeg") == 0)
{
if (settings->JpegQuality == 0)
settings->JpegQuality = 75;
}
-
#endif
}
CommandLineSwitchCase(arg, "fast-path")