1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-16 23:03:01 +01:00

Add option that prints toxic and toxcore version

This commit is contained in:
jfreegman 2017-01-25 22:13:59 -05:00
parent 7a7402ff86
commit 451d4ced80
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63
2 changed files with 12 additions and 5 deletions

View File

@ -835,6 +835,13 @@ static void print_usage(void)
fprintf(stderr, " -t, --force-tcp Force toxic to use a TCP connection (use with proxies)\n"); fprintf(stderr, " -t, --force-tcp Force toxic to use a TCP connection (use with proxies)\n");
fprintf(stderr, " -T, --tcp-server Act as a TCP relay server: Requires [port]\n"); fprintf(stderr, " -T, --tcp-server Act as a TCP relay server: Requires [port]\n");
fprintf(stderr, " -u, --unencrypt-data Unencrypt an encrypted data file\n"); fprintf(stderr, " -u, --unencrypt-data Unencrypt an encrypted data file\n");
fprintf(stderr, " -v, --version Print the version\n");
}
static void print_version(void)
{
fprintf(stderr, "Toxic version %s\n", TOXICVER);
fprintf(stderr, "Toxcore version %d.%d.%d\n", tox_version_major(), tox_version_minor(), tox_version_patch());
} }
static void set_default_opts(void) static void set_default_opts(void)
@ -865,10 +872,11 @@ static void parse_args(int argc, char *argv[])
{"SOCKS5-proxy", required_argument, 0, 'p'}, {"SOCKS5-proxy", required_argument, 0, 'p'},
{"HTTP-proxy", required_argument, 0, 'P'}, {"HTTP-proxy", required_argument, 0, 'P'},
{"unencrypt-data", no_argument, 0, 'u'}, {"unencrypt-data", no_argument, 0, 'u'},
{"version", no_argument, 0, 'v'},
{NULL, no_argument, NULL, 0}, {NULL, no_argument, NULL, 0},
}; };
const char *opts_str = "4bdehotuxc:f:n:r:p:P:T:"; const char *opts_str = "4bdehotuxvc:f:n:r:p:P:T:";
int opt, indexptr; int opt, indexptr;
long int port = 0; long int port = 0;
@ -991,6 +999,9 @@ static void parse_args(int argc, char *argv[])
arg_opts.unencrypt_data = 1; arg_opts.unencrypt_data = 1;
break; break;
case 'v':
print_version();
exit(EXIT_SUCCESS);
case 'h': case 'h':
default: default:
print_usage(); print_usage();

View File

@ -475,10 +475,6 @@ static void draw_bar(void)
move(LINES - 1, 0); move(LINES - 1, 0);
attron(COLOR_PAIR(BLUE) | A_BOLD);
printw(" TOXIC " TOXICVER " |");
attroff(COLOR_PAIR(BLUE) | A_BOLD);
size_t i; size_t i;
for (i = 0; i < MAX_WINDOWS_NUM; ++i) { for (i = 0; i < MAX_WINDOWS_NUM; ++i) {