From 77102db288e533050397128da182b081a98211f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 30 Apr 2020 12:38:36 +0200 Subject: [PATCH] systemctl: fix hint when 'systemctl help' is given Not all verbs require unit names, but that is beside the point. We need a verb here, and help is not a valid verb. --- src/shared/verbs.c | 4 ++-- src/systemctl/systemctl.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/shared/verbs.c b/src/shared/verbs.c index 1d23ed48a2..06d89b4736 100644 --- a/src/shared/verbs.c +++ b/src/shared/verbs.c @@ -68,9 +68,9 @@ int dispatch_verb(int argc, char *argv[], const Verb verbs[], void *userdata) { /* At the end of the list? */ if (!verbs[i].dispatch) { if (name) - log_error("Unknown operation %s.", name); + log_error("Unknown command verb %s.", name); else - log_error("Requires operation parameter."); + log_error("Command verb required."); return -EINVAL; } diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index d319d5d375..d5dc52853a 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -5860,7 +5860,8 @@ static int show(int argc, char *argv[], void *userdata) { if (show_mode == SYSTEMCTL_SHOW_HELP && argc <= 1) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), - "This command expects one or more unit names. Did you mean --help?"); + "'help' command expects one or more unit names.\n" + "(Alternatively, help for systemctl itself may be shown with --help)"); r = acquire_bus(BUS_MANAGER, &bus); if (r < 0) -- 2.25.1