summaryrefslogtreecommitdiff
path: root/src/hostname/hostnamectl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hostname/hostnamectl.c')
-rw-r--r--src/hostname/hostnamectl.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c
index d8657fa4d..af4281791 100644
--- a/src/hostname/hostnamectl.c
+++ b/src/hostname/hostnamectl.c
@@ -314,13 +314,13 @@ static int parse_argv(int argc, char *argv[]) {
static const struct option options[] = {
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, ARG_VERSION },
- { "transient", no_argument, NULL, ARG_TRANSIENT },
- { "static", no_argument, NULL, ARG_STATIC },
- { "pretty", no_argument, NULL, ARG_PRETTY },
+ { "transient", no_argument, NULL, ARG_TRANSIENT },
+ { "static", no_argument, NULL, ARG_STATIC },
+ { "pretty", no_argument, NULL, ARG_PRETTY },
{ "host", required_argument, NULL, 'H' },
{ "machine", required_argument, NULL, 'M' },
{ "no-ask-password", no_argument, NULL, ARG_NO_ASK_PASSWORD },
- { NULL, 0, NULL, 0 }
+ {}
};
int c;
@@ -333,8 +333,7 @@ static int parse_argv(int argc, char *argv[]) {
switch (c) {
case 'h':
- help();
- return 0;
+ return help();
case ARG_VERSION:
puts(PACKAGE_STRING);
@@ -371,8 +370,7 @@ static int parse_argv(int argc, char *argv[]) {
return -EINVAL;
default:
- log_error("Unknown option code %c", c);
- return -EINVAL;
+ assert_not_reached("Unhandled option");
}
}