wg: include tools version
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
2f74ac29cf
commit
262b5196cf
1
src/version.h
Normal file
1
src/version.h
Normal file
|
@ -0,0 +1 @@
|
|||
#define WIREGUARD_TOOLS_VERSION "0.0.20191219"
|
5
src/wg.c
5
src/wg.c
|
@ -8,6 +8,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "subcommands.h"
|
||||
#include "version.h"
|
||||
|
||||
const char *PROG_NAME;
|
||||
|
||||
|
@ -40,6 +41,10 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
PROG_NAME = argv[0];
|
||||
|
||||
if (argc == 2 && (!strcmp(argv[1], "-v") || !strcmp(argv[1], "--version") || !strcmp(argv[1], "version"))) {
|
||||
printf("wireguard-tools v%s - https://git.zx2c4.com/wireguard-tools/\n", WIREGUARD_TOOLS_VERSION);
|
||||
return 0;
|
||||
}
|
||||
if (argc == 2 && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help") || !strcmp(argv[1], "help"))) {
|
||||
show_usage(stdout);
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue