From ca73159c14782c4790d393ab3872c3581dc986bf Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 22 Nov 2020 08:45:48 +0000 Subject: [PATCH] Support -logoverwrite and -logappend command-line flags. If it's worth having command-line options to _specify_ a log file, it's also worth having options to avoid having to answer an interactive prompt _about_ that log file every time. (Particularly useful when debugging, in which I often want to run a zillion instances of the same quite temporary command line that involves writing a log file.) --- cmdline.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmdline.c b/cmdline.c index e7cdc9aa..7203c3aa 100644 --- a/cmdline.c +++ b/cmdline.c @@ -807,6 +807,20 @@ int cmdline_process_param(const char *p, char *value, filename_free(fn); } + if (!strcmp(p, "-logoverwrite")) { + RETURN(1); + UNAVAILABLE_IN(TOOLTYPE_NONNETWORK); + SAVEABLE(0); + conf_set_int(conf, CONF_logxfovr, LGXF_OVR); + } + + if (!strcmp(p, "-logappend")) { + RETURN(1); + UNAVAILABLE_IN(TOOLTYPE_NONNETWORK); + SAVEABLE(0); + conf_set_int(conf, CONF_logxfovr, LGXF_APN); + } + if (!strcmp(p, "-proxycmd")) { RETURN(2); UNAVAILABLE_IN(TOOLTYPE_NONNETWORK);