diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2020-04-19 11:28:39 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2020-04-19 11:28:39 +0200 |
commit | 0b994d718d32bee9d3ea2b215c12f04685ca2a8c (patch) | |
tree | 5b6629808348c7045756c4c8469771571fd17d97 /src/gui/curses/headless/main.c | |
parent | 18a837c55bc25ebdd6ad25055bd8ae446dc57b5e (diff) | |
download | weechat-0b994d718d32bee9d3ea2b215c12f04685ca2a8c.zip |
core: add command line option "--stdout" in weechat-headless binary (closes #1475, closes #1477)
Diffstat (limited to 'src/gui/curses/headless/main.c')
-rw-r--r-- | src/gui/curses/headless/main.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/curses/headless/main.c b/src/gui/curses/headless/main.c index 99df53d99..b6dd49e54 100644 --- a/src/gui/curses/headless/main.c +++ b/src/gui/curses/headless/main.c @@ -101,8 +101,9 @@ main (int argc, char *argv[]) weechat_headless = 1; /* - * If "--daemon" is received in command line arguments, - * daemonize the process. + * Parse extra options for headless mode: + * - "--daemon": daemonize the process + * - "--stdout": log messages to stdout (instead of log file) */ weechat_daemon = 0; for (i = 1; i < argc; i++) @@ -110,11 +111,17 @@ main (int argc, char *argv[]) if (strcmp (argv[i], "--daemon") == 0) { weechat_daemon = 1; - break; + } + else if (strcmp (argv[i], "--stdout") == 0) + { + weechat_log_stdout = 1; } } if (weechat_daemon) + { + weechat_log_stdout = 0; daemonize (); + } /* init, main loop and end */ weechat_init (argc, argv, &gui_main_init); |