chiark / gitweb /
Remove src/machine-id-commit
[elogind.git] / src / machine-id-setup / machine-id-setup-main.c
index a67d436dbd7c40a5f305a8ad535ffe220c0b836d..20cb60b804592f4896eb70cfe35e6708617222ef 100644 (file)
@@ -19,7 +19,6 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <getopt.h>
 
 static const char *arg_root = "";
 
-static int help(void) {
-
+static void help(void) {
         printf("%s [OPTIONS...]\n\n"
                "Initialize /etc/machine-id from a random source.\n\n"
                "  -h --help             Show this help\n"
                "     --version          Show package version\n"
-               "     --root             Filesystem root\n",
+               "     --root=ROOT        Filesystem root\n",
                program_invocation_short_name);
-
-        return 0;
 }
 
 static int parse_argv(int argc, char *argv[]) {
@@ -62,12 +58,13 @@ static int parse_argv(int argc, char *argv[]) {
         assert(argc >= 0);
         assert(argv);
 
-        while ((c = getopt_long(argc, argv, "hqcv", options, NULL)) >= 0) {
+        while ((c = getopt_long(argc, argv, "hqcv", options, NULL)) >= 0)
 
                 switch (c) {
 
                 case 'h':
-                        return help();
+                        help();
+                        return 0;
 
                 case ARG_VERSION:
                         puts(PACKAGE_STRING);
@@ -84,10 +81,9 @@ static int parse_argv(int argc, char *argv[]) {
                 default:
                         assert_not_reached("Unhandled option");
                 }
-        }
 
         if (optind < argc) {
-                help();
+                log_error("Extraneous arguments");
                 return -EINVAL;
         }