From 816ce4eeee842b83a22ee7103eec7ef432678095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 25 Jul 2026 11:50:04 -0600 Subject: [PATCH] notify: do not print full help output on error Printing a wall of text is obnoxious. Just tell the user what the problem was. --- src/notify/notify.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/notify/notify.c b/src/notify/notify.c index 667a7a6447..b322c5fc7f 100644 --- a/src/notify/notify.c +++ b/src/notify/notify.c @@ -283,7 +283,7 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) { case ACTION_NOTIFY: { if (arg_fdname && fdset_isempty(arg_fds)) - return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "No file descriptors passed, but --fdname= set, refusing."); + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "No file descriptors passed, but --fdname= used, refusing."); size_t n_arg_env; @@ -308,14 +308,10 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) { n_arg_env = strv_length(args); have_env = have_env || n_arg_env > 0; - if (!have_env) { - if (do_exec) - return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "No notify message specified while --exec, refusing."); - - /* No argument at all? */ - help(); - return -EINVAL; - } + if (!have_env) + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), + do_exec ? "No notify message specified with --exec, refusing." : + "Nothing to notify about was specified."); if (n_arg_env > 0) { arg_env = strv_copy_n(args, n_arg_env);