diff --git a/iodine.c b/iodine.c index d889b5e..7d0c646 100644 --- a/iodine.c +++ b/iodine.c @@ -117,18 +117,27 @@ extern char *__progname; static void usage() { - printf("Usage: %s [-f] [-u user] nameserver topdomain\n", __progname); + printf("Usage: %s [-v] [-h] [-f] [-u user] nameserver topdomain\n", __progname); exit(2); } static void help() { - printf("Usage: %s [-f] [-u user] nameserver topdomain\n", __progname); + printf("iodine IP over DNS tunneling client\n"); + printf("Usage: %s [-v] [-h] [-f] [-u user] nameserver topdomain\n", __progname); printf(" -f is to keep running in foreground\n"); printf(" -u name to drop privileges and run as user 'name'\n"); exit(0); } +static void +version() { + char *svnver = "$Id$"; + printf("iodine IP over DNS tunneling client\n"); + printf("SVN version: %s\n", svnver); + exit(0); +} + int main(int argc, char **argv) { @@ -147,8 +156,11 @@ main(int argc, char **argv) usage(); } - while ((choice = getopt(argc, argv, "fhu:")) != -1) { + while ((choice = getopt(argc, argv, "vfhu:")) != -1) { switch(choice) { + case 'v': + version(); + break; case 'f': foreground = 1; break; diff --git a/iodined.c b/iodined.c index 4cffdd8..bc868c6 100644 --- a/iodined.c +++ b/iodined.c @@ -116,18 +116,27 @@ extern char *__progname; static void usage() { - printf("Usage: %s [-f] [-u user] topdomain\n", __progname); + printf("Usage: %s [-v] [-h] [-f] [-u user] topdomain\n", __progname); exit(2); } static void help() { - printf("Usage: %s [-f] [-u user] topdomain\n", __progname); + printf("iodine IP over DNS tunneling client\n"); + printf("Usage: %s [-v] [-h] [-f] [-u user] topdomain\n", __progname); printf(" -f to keep running in foreground\n"); printf(" -u name to drop privileges and run as user 'name'\n"); exit(0); } +static void +version() { + char *svnver = "$Id$"; + printf("iodine IP over DNS tunneling server\n"); + printf("SVN version: %s\n", svnver); + exit(0); +} + int main(int argc, char **argv) { @@ -146,8 +155,11 @@ main(int argc, char **argv) usage(); } - while ((choice = getopt(argc, argv, "fhu:")) != -1) { + while ((choice = getopt(argc, argv, "vfhu:")) != -1) { switch(choice) { + case 'v': + version(); + break; case 'f': foreground = 1; break;