瀏覽代碼

vcc: increase the minor and update help message

intirain 4 年之前
父節點
當前提交
e5ce767b48
共有 3 個文件被更改,包括 18 次插入 和 6 次删除
  1. 2 2
      Makefile
  2. 1 1
      include/vcc/version.h
  3. 15 3
      main.c

+ 2 - 2
Makefile

@@ -1,6 +1,6 @@
 VCC_MAJOR 		= 1
-VCC_MINOR 		= 5
-VCC_PATCH 		= 3
+VCC_MINOR 		= 6
+VCC_PATCH 		= 0
 VCC_STR 		= -rc 
 
 VCC_COMPILE_TIME 	= $(shell date)

+ 1 - 1
include/vcc/version.h

@@ -1,2 +1,2 @@
-#define VCC_VERSION "VCC 1.5.3 Sun 03 Apr 2022 04:14:54 PM CST ubuntu"
+#define VCC_VERSION "VCC 1.5.3 Sun Apr  3 19:40:00 CST 2022 root"
 #define VCC_SEMVER "vcc 1.5.3-rc "

+ 15 - 3
main.c

@@ -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);