|
|
@@ -60,9 +60,20 @@ char usrname[USRNAME_SIZE];
|
|
|
|
|
|
extern int current_sid;
|
|
|
|
|
|
+static char const *help_msg = {
|
|
|
+ "Usage: vcc [-up] [server]\n"
|
|
|
+ "Options: \n"
|
|
|
+ " -u --user Set the username on the server. "
|
|
|
+ "If unspecified, you must input it interatively. \n"
|
|
|
+ " -p --port Specified the port on the server. "
|
|
|
+ "Default port is 46. You must keep this as same "
|
|
|
+ "as the port on the server. \n"
|
|
|
+ " [server] Address of the server. "
|
|
|
+ "As default, server is 124.223.105.230. \n"
|
|
|
+};
|
|
|
+
|
|
|
static int usage(void) {
|
|
|
- fprintf(stderr, "Usage: vcc [server]\n");
|
|
|
- fprintf(stderr, "As default, server is 124.223.105.230. \n");
|
|
|
+ fprintf(stderr, help_msg);
|
|
|
|
|
|
return 1;
|
|
|
}
|
|
|
@@ -132,6 +143,7 @@ int main(int argc, char **argv) {
|
|
|
char *buf, *msg, *ip = "124.223.105.230";
|
|
|
int n, size, port = VCC_PORT, got_usrname;
|
|
|
(void) argc;
|
|
|
+
|
|
|
#ifdef _WIN32
|
|
|
setlocale(LC_ALL, ".UTF-8");
|
|
|
#else
|
|
|
@@ -141,10 +153,10 @@ int main(int argc, char **argv) {
|
|
|
printf(VCC_VERSION "\n");
|
|
|
|
|
|
got_usrname = parse_args(argv, &port, &ip);
|
|
|
-
|
|
|
init_socket(ip, port);
|
|
|
|
|
|
printf("Connected to server. \n");
|
|
|
+ printf("%s@%s%d\n", usrname, ip, port);
|
|
|
|
|
|
login(got_usrname);
|
|
|
|