Add option version
This commit is contained in:
@@ -511,11 +511,12 @@ int main (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
gt_set_signal();
|
gt_set_signal();
|
||||||
|
|
||||||
|
char *dev = PACKAGE_NAME;
|
||||||
char *host = NULL;
|
char *host = NULL;
|
||||||
char *port = "5000";
|
char *port = "5000";
|
||||||
char *dev = "glorytun";
|
|
||||||
int listener = 0;
|
int listener = 0;
|
||||||
char *congestion = NULL;
|
char *congestion = NULL;
|
||||||
|
int version = 0;
|
||||||
|
|
||||||
struct option opts[] = {
|
struct option opts[] = {
|
||||||
{ "dev", &dev, option_str },
|
{ "dev", &dev, option_str },
|
||||||
@@ -523,12 +524,18 @@ int main (int argc, char **argv)
|
|||||||
{ "port", &port, option_str },
|
{ "port", &port, option_str },
|
||||||
{ "listener", &listener, option_flag },
|
{ "listener", &listener, option_flag },
|
||||||
{ "congestion", &congestion, option_str },
|
{ "congestion", &congestion, option_str },
|
||||||
|
{ "version", &version, option_flag },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
if (option(opts, argc, argv))
|
if (option(opts, argc, argv))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
if (version) {
|
||||||
|
printf(PACKAGE_STRING"\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (sodium_init()==-1) {
|
if (sodium_init()==-1) {
|
||||||
printf("libsodium initialization has failed!\n");
|
printf("libsodium initialization has failed!\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user