mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-22 21:53:05 +01:00
Add option that prints toxic and toxcore version
This commit is contained in:
parent
7a7402ff86
commit
451d4ced80
13
src/toxic.c
13
src/toxic.c
@ -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, --tcp-server Act as a TCP relay server: Requires [port]\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)
|
||||
@ -865,10 +872,11 @@ static void parse_args(int argc, char *argv[])
|
||||
{"SOCKS5-proxy", required_argument, 0, 'p'},
|
||||
{"HTTP-proxy", required_argument, 0, 'P'},
|
||||
{"unencrypt-data", no_argument, 0, 'u'},
|
||||
{"version", no_argument, 0, 'v'},
|
||||
{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;
|
||||
long int port = 0;
|
||||
|
||||
@ -991,6 +999,9 @@ static void parse_args(int argc, char *argv[])
|
||||
arg_opts.unencrypt_data = 1;
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
print_version();
|
||||
exit(EXIT_SUCCESS);
|
||||
case 'h':
|
||||
default:
|
||||
print_usage();
|
||||
|
@ -475,10 +475,6 @@ static void draw_bar(void)
|
||||
|
||||
move(LINES - 1, 0);
|
||||
|
||||
attron(COLOR_PAIR(BLUE) | A_BOLD);
|
||||
printw(" TOXIC " TOXICVER " |");
|
||||
attroff(COLOR_PAIR(BLUE) | A_BOLD);
|
||||
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||
|
Loading…
Reference in New Issue
Block a user