Browse Source

update: show version info

master
dnomd343 2 years ago
parent
commit
ca4b462132
  1. 2
      include/common.h
  2. 4
      src/common.c
  3. 2
      src/local.c
  4. 2
      src/server.c

2
include/common.h

@ -1,7 +1,7 @@
#ifndef _COMMON_H_ #ifndef _COMMON_H_
#define _COMMON_H_ #define _COMMON_H_
#define VERSION "0.9.5" #define VERSION "1.0.0-beta"
#define RANDOM_PORT_START 41952 #define RANDOM_PORT_START 41952
#define RANDOM_PORT_END 65535 #define RANDOM_PORT_END 65535

4
src/common.c

@ -64,7 +64,7 @@ char* read_file(char *file_name) { // read file content
void init(int argc, char **argv, char *help_msg) { void init(int argc, char **argv, char *help_msg) {
if (argc <= 1) { // with only one argument if (argc <= 1) { // with only one argument
printf("%s", help_msg); printf(help_msg, VERSION);
exit(0); exit(0);
} }
for (int i = 0; i < argc; ++i) { for (int i = 0; i < argc; ++i) {
@ -72,7 +72,7 @@ void init(int argc, char **argv, char *help_msg) {
LOG_LEVEL = LOG_DEBUG; LOG_LEVEL = LOG_DEBUG;
} }
if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { // include `-h` or `--help` if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { // include `-h` or `--help`
printf("%s", help_msg); printf(help_msg, VERSION);
exit(0); exit(0);
} }
} }

2
src/local.c

@ -4,7 +4,7 @@
#include "process.h" #include "process.h"
char *help_msg = "\n\ char *help_msg = "\n\
ss-bootstrap-local\n\ ss-bootstrap-local (%s)\n\
\n\ \n\
A simple program to make the original shadowsocks support SIP003 plugins.\n\ A simple program to make the original shadowsocks support SIP003 plugins.\n\
\n\ \n\

2
src/server.c

@ -4,7 +4,7 @@
#include "process.h" #include "process.h"
char *help_msg = "\n\ char *help_msg = "\n\
ss-bootstrap-server\n\ ss-bootstrap-server (%s)\n\
\n\ \n\
A simple program to make the original shadowsocks support SIP003 plugins.\n\ A simple program to make the original shadowsocks support SIP003 plugins.\n\
\n\ \n\

Loading…
Cancel
Save