From 528213cc8c44ad62e59631ba816e7b82ef7a6e02 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 22 Dec 2009 21:52:59 +0000 Subject: added version info into binary --- src/options.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/options.c') diff --git a/src/options.c b/src/options.c index f5010bf..906e43e 100644 --- a/src/options.c +++ b/src/options.c @@ -34,6 +34,7 @@ */ #include "datatypes.h" +#include "version.h" #include "options.h" @@ -233,6 +234,8 @@ int options_parse(options_t* opt, int argc, char* argv[]) if(!strcmp(str,"-h") || !strcmp(str,"--help")) return -1; + else if(!strcmp(str,"-v") || !strcmp(str,"--version")) + return -5; PARSE_INVERSE_BOOL_PARAM("-D","--nodaemonize", opt->daemonize_) PARSE_STRING_PARAM("-u","--username", opt->username_) PARSE_STRING_PARAM("-g","--groupname", opt->groupname_) @@ -420,6 +423,7 @@ void options_print_usage() { printf("USAGE:\n"); printf("uanytun [-h|--help] prints this...\n"); + printf(" [-v|--version] print version info and exit\n"); printf(" [-D|--nodaemonize] don't run in background\n"); printf(" [-u|--username] change to this user\n"); printf(" [-g|--groupname] change to this group\n"); @@ -456,6 +460,12 @@ void options_print_usage() #endif } +void options_print_version() +{ + printf("%s\n", VERSION_STRING_0); + printf("%s\n", VERSION_STRING_1); +} + void options_print(options_t* opt) { if(!opt) -- cgit v1.2.3