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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2020-04-30 12:38:36 +02:00
parent b8239b9c50
commit 77102db288
2 changed files with 4 additions and 3 deletions

View 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;
}

View 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)