]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: fix hint when 'systemctl help' is given
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 30 Apr 2020 10:38:36 +0000 (12:38 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 5 May 2020 16:04:28 +0000 (18:04 +0200)
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
src/systemctl/systemctl.c

index 1d23ed48a2b87635b232dca04ed86264ee740a59..06d89b4736375e45462144ee58db7f707e69c78a 100644 (file)
@@ -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;
                 }
 
index d319d5d375488b3aa510aa6aeb8b721c635fada5..d5dc52853a407767ce3af2ef432de51f0218c145 100644 (file)
@@ -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)