1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-07 02:03:13 +02:00

core: add command line option "--stdout" in weechat-headless binary (closes #1475, closes #1477)

This commit is contained in:
Sébastien Helleu
2020-04-19 11:28:39 +02:00
parent 18a837c55b
commit 0b994d718d
34 changed files with 216 additions and 29 deletions
+10 -3
View File
@@ -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);