From 9be8980a2bb6245da017270f85bd6da186fb433b Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sun, 15 Jul 2012 21:17:10 +0200 Subject: [PATCH] Let tincctl ignore tincd options, so they will be passed on. --- doc/tinc.texi | 4 ++-- doc/tincctl.8.in | 5 +++-- src/tincctl.c | 12 ++++++++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/doc/tinc.texi b/doc/tinc.texi index 66300eae..32944395 100644 --- a/doc/tinc.texi +++ b/doc/tinc.texi @@ -2060,8 +2060,8 @@ If no @var{value} is given, all configuration variables with the same name will Start an editor for the given configuration file. You do not need to specify the full path to the file. -@item start -Start @samp{tincd}. +@item start [tincd options] +Start @samp{tincd}, optionally with the given extra options. @item stop Stop @samp{tincd}. diff --git a/doc/tincctl.8.in b/doc/tincctl.8.in index 8a9bfcdd..788e7f1b 100644 --- a/doc/tincctl.8.in +++ b/doc/tincctl.8.in @@ -71,9 +71,10 @@ is given, all configuration variables with the same name will be removed. .It edit Ar filename Start an editor for the given configuration file. You do not need to specify the full path to the file. -.It start +.It start Op tincd options Start -.Xr tincd 8 . +.Xr tincd 8 , +optionally with the given extra options. .It stop Stop .Xr tincd 8 . diff --git a/src/tincctl.c b/src/tincctl.c index c1654186..09010eaf 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -62,10 +62,18 @@ static struct WSAData wsa_state; static struct option const long_options[] = { {"config", required_argument, NULL, 'c'}, + {"debug", optional_argument, NULL, 0}, + {"no-detach", no_argument, NULL, 0}, + {"mlock", no_argument, NULL, 0}, {"net", required_argument, NULL, 'n'}, {"help", no_argument, NULL, 1}, {"version", no_argument, NULL, 2}, {"pidfile", required_argument, NULL, 5}, + {"logfile", required_argument, NULL, 0}, + {"bypass-security", no_argument, NULL, 0}, + {"chroot", no_argument, NULL, 0}, + {"user", required_argument, NULL, 0}, + {"option", required_argument, NULL, 0}, {NULL, 0, NULL, 0} }; @@ -98,7 +106,7 @@ static void usage(bool status) { " [set] VARIABLE VALUE - set VARIABLE to VALUE\n" " add VARIABLE VALUE - add VARIABLE with the given VALUE\n" " del VARIABLE [VALUE] - remove VARIABLE [only ones with watching VALUE]\n" - " start Start tincd.\n" + " start [tincd options] Start tincd.\n" " stop Stop tincd.\n" " restart Restart tincd.\n" " reload Partially reload configuration of running tincd.\n" @@ -130,7 +138,7 @@ static bool parse_options(int argc, char **argv) { int r; int option_index = 0; - while((r = getopt_long(argc, argv, "c:n:", long_options, &option_index)) != EOF) { + while((r = getopt_long(argc, argv, "c:n:Dd::Lo:RU:", long_options, &option_index)) != EOF) { switch (r) { case 0: /* long option */ break; -- 2.20.1