summaryrefslogtreecommitdiff
path: root/src/machine-id-setup/machine-id-setup-main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/machine-id-setup/machine-id-setup-main.c')
-rw-r--r--src/machine-id-setup/machine-id-setup-main.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/machine-id-setup/machine-id-setup-main.c b/src/machine-id-setup/machine-id-setup-main.c
index 1c933ce600..85bbfc4299 100644
--- a/src/machine-id-setup/machine-id-setup-main.c
+++ b/src/machine-id-setup/machine-id-setup-main.c
@@ -31,16 +31,13 @@
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=ROOT Filesystem root\n",
program_invocation_short_name);
-
- return 0;
}
static int parse_argv(int argc, char *argv[]) {
@@ -62,12 +59,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,7 +82,6 @@ static int parse_argv(int argc, char *argv[]) {
default:
assert_not_reached("Unhandled option");
}
- }
if (optind < argc) {
log_error("Extraneous arguments");