--- sourceforge.net/trunk/rdesktop/rdesktop.c 2000/08/15 10:23:24 10 +++ sourceforge.net/trunk/rdesktop/rdesktop.c 2000/10/16 08:44:48 21 @@ -21,7 +21,6 @@ #include /* malloc realloc free */ #include /* read close getuid getgid getpid getppid gethostname */ #include /* open */ -#include /* getopt */ #include /* getpwuid */ #include /* stat */ #include /* gettimeofday */ @@ -33,7 +32,7 @@ int width = 800; int height = 600; int keylayout = 0x409; -BOOL motion = False; +BOOL motion = True; BOOL orders = True; BOOL licence = True; @@ -42,12 +41,16 @@ { STATUS("Usage: %s [options] server\n", program); STATUS(" -u: user name\n"); + STATUS(" -d: domain\n"); + STATUS(" -s: shell\n"); + STATUS(" -c: working directory\n"); + STATUS(" -p: password (autologon)\n"); STATUS(" -n: client hostname\n"); STATUS(" -w: desktop width\n"); STATUS(" -h: desktop height\n"); STATUS(" -k: keyboard layout (hex)\n"); - STATUS(" -m: send motion events\n"); STATUS(" -b: force bitmap updates\n"); + STATUS(" -m: do not send motion events\n"); STATUS(" -l: do not request licence\n\n"); } @@ -56,13 +59,22 @@ { struct passwd *pw; char *server; + uint32 flags; + char domain[16]; + char password[16]; + char shell[32]; + char directory[32]; char title[32]; int c; STATUS("rdesktop: A Remote Desktop Protocol client.\n"); - STATUS("Version "VERSION". Copyright (C) 1999-2000 Matt Chapman.\n\n"); + STATUS("Version "VERSION". Copyright (C) 1999-2000 Matt Chapman.\n"); + STATUS("See http://www.rdesktop.org/ for more information.\n\n"); - while ((c = getopt(argc, argv, "u:n:w:h:k:mbl?")) != -1) + flags = RDP_LOGON_NORMAL; + domain[0] = password[0] = shell[0] = directory[0] = 0; + + while ((c = getopt(argc, argv, "u:d:s:c:p:n:w:h:k:bml?")) != -1) { switch (c) { @@ -70,6 +82,23 @@ strncpy(username, optarg, sizeof(username)); break; + case 'd': + strncpy(domain, optarg, sizeof(domain)); + break; + + case 'p': + flags |= RDP_LOGON_AUTO; + strncpy(password, optarg, sizeof(password)); + break; + + case 's': + strncpy(shell, optarg, sizeof(shell)); + break; + + case 'c': + strncpy(directory, optarg, sizeof(directory)); + break; + case 'n': strncpy(hostname, optarg, sizeof(hostname)); break; @@ -87,7 +116,7 @@ break; case 'm': - motion = True; + motion = False; break; case 'b': @@ -134,12 +163,14 @@ } } - if (!rdp_connect(server)) + if (!rdp_connect(server, flags, domain, password, shell, directory)) return 1; STATUS("Connection successful.\n"); - snprintf(title, sizeof(title), "rdesktop - %s", server); + strcpy(title, "rdesktop - "); + strncat(title, server, sizeof(title)); + if (ui_create_window(title)) { rdp_main_loop();