Browse Source

add --version switch

git.mgm/mediaproxy-ng/2.0
Richard Fuchs 15 years ago
parent
commit
5142f39e12
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      daemon/main.c

+ 6
- 0
daemon/main.c View File

@ -17,6 +17,7 @@
#ifndef NO_REDIS #ifndef NO_REDIS
#include "redis.h" #include "redis.h"
#endif #endif
#include "build_time.h"
@ -115,8 +116,10 @@ static void options(int *argc, char ***argv) {
#ifndef NO_REDIS #ifndef NO_REDIS
static char *redisps; static char *redisps;
#endif #endif
static int version;
static GOptionEntry e[] = { static GOptionEntry e[] = {
{ "version", 'v', 0, G_OPTION_ARG_NONE, &version, "Print build time and exit", NULL },
{ "table", 't', 0, G_OPTION_ARG_INT, &table, "Kernel table to use", "INT" }, { "table", 't', 0, G_OPTION_ARG_INT, &table, "Kernel table to use", "INT" },
{ "ip", 'i', 0, G_OPTION_ARG_STRING, &ips, "Local IP address for RTP", "IP" }, { "ip", 'i', 0, G_OPTION_ARG_STRING, &ips, "Local IP address for RTP", "IP" },
{ "advertised-ip", 'a', 0, G_OPTION_ARG_STRING, &adv_ips, "IP address to advertise", "IP" }, { "advertised-ip", 'a', 0, G_OPTION_ARG_STRING, &adv_ips, "IP address to advertise", "IP" },
@ -144,6 +147,9 @@ static void options(int *argc, char ***argv) {
if (!g_option_context_parse(c, argc, argv, &er)) if (!g_option_context_parse(c, argc, argv, &er))
die("Bad command line: %s\n", er->message); die("Bad command line: %s\n", er->message);
if (version)
die("Build time: %s\n", BUILD_TIME);
if (!ips) if (!ips)
die("Missing option --ip\n"); die("Missing option --ip\n");
if (!listenps && !listenudps) if (!listenps && !listenudps)


Loading…
Cancel
Save