Commit 2f02ce40 authored by Lennart Poettering's avatar Lennart Poettering
Browse files

utils: show help blurb when run without any arguments

parent 6f6083dc
......@@ -132,7 +132,7 @@ static int parse_argv(int argc, char *argv[]) {
}
if (optind >= argc) {
log_error("Missing verb.");
help();
return -EINVAL;
}
......@@ -143,7 +143,7 @@ static int parse_argv(int argc, char *argv[]) {
else if (streq(argv[optind], "test"))
arg_action = ACTION_TEST;
else {
log_error("Unknown verb %s", argv[optind]);
log_error("Unknown verb %s.", argv[optind]);
return -EINVAL;
}
......
......@@ -115,6 +115,15 @@ static int parse_argv(int argc, char *argv[]) {
}
}
if (optind >= argc &&
!arg_ready &&
!arg_status &&
!arg_pid &&
!arg_booted) {
help();
return -EINVAL;
}
return 1;
}
......
......@@ -1839,7 +1839,7 @@ static int telinit_parse_argv(int argc, char *argv[]) {
}
if (optind >= argc) {
log_error("Argument missing.");
telinit_help();
return -EINVAL;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment