From e0fa20239b0220906ed72f5cdd96c9940d4cd5c9 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sun, 19 Jan 2025 16:31:34 -0800 Subject: vmon: add some sanity checks for weird flag combinations These are just some potentially helpful warnings, they're not treated as fatal... just informative regarding somewhat obviously confused combinations. --- src/vmon.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/vmon.c b/src/vmon.c index 927323b..6a08a14 100644 --- a/src/vmon.c +++ b/src/vmon.c @@ -731,6 +731,14 @@ static vmon_t * vmon_startup(int argc, const char * const *argv) } } + /* lets do some sanity checks; don't fail, but speak up, since I'm not interested */ + if (vmon->headless && vmon->linger) + VWM_ERROR("FYI: combining --headless and --linger likely doesn't make sense"); + + if (vmon->reaper && !vmon->execv) + VWM_ERROR("FYI: using --reaper without a command (e.g. w/--pid or the default '--pid 1' equiv) likely doesn't make sense"); + + return vmon; _err_win: -- cgit v1.2.3