chiark / gitweb /
utils: show help blurb when run without any arguments
[elogind.git] / src / install.c
index e59e108c02459848e092d1fa9c667f646acb358b..f56c0728b932e768357c7ce51ea859529f92ffe8 100644 (file)
@@ -59,13 +59,13 @@ Hashmap *will_install = NULL, *have_installed = NULL;
 
 static int help(void) {
 
 
 static int help(void) {
 
-        printf("%s [options]\n\n"
+        printf("%s [OPTIONS...] {COMMAND} ...\n\n"
                "Install init system units.\n\n"
                "  -h --help        Show this help\n"
                "     --force       Override existing links\n"
                "     --system      Install into system\n"
                "     --session     Install into session\n"
                "Install init system units.\n\n"
                "  -h --help        Show this help\n"
                "     --force       Override existing links\n"
                "     --system      Install into system\n"
                "     --session     Install into session\n"
-               "     --global      Install into all sessions\n"
+               "     --global      Install into all sessions\n\n"
                "Commands:\n"
                "  enable [NAME...]    Enable one or more units\n"
                "  disable [NAME...]   Disable one or more units\n"
                "Commands:\n"
                "  enable [NAME...]    Enable one or more units\n"
                "  disable [NAME...]   Disable one or more units\n"
@@ -132,7 +132,7 @@ static int parse_argv(int argc, char *argv[]) {
         }
 
         if (optind >= argc) {
         }
 
         if (optind >= argc) {
-                log_error("Missing verb.");
+                help();
                 return -EINVAL;
         }
 
                 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 {
         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;
         }
 
                 return -EINVAL;
         }