summaryrefslogtreecommitdiff
path: root/src/userdb
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-15 19:41:39 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-17 21:08:47 +0100
commitc3470872c6c12d64c895643bd3b02022beb0589e (patch)
treebb46f589f8e8dd983e57b233e5736595b65ef169 /src/userdb
parent599c7c545f689f7d19a73238eecc69bf94fa6a74 (diff)
downloadsystemd-c3470872c6c12d64c895643bd3b02022beb0589e.tar.gz
tree-wide: use parse_boolean_argument() for variables with non-boolean type
This still works nicely, but we need to assign the return value ourselves. As before, one nice effect is that error messages are uniform.
Diffstat (limited to 'src/userdb')
-rw-r--r--src/userdb/userdbctl.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/userdb/userdbctl.c b/src/userdb/userdbctl.c
index f4204759db..102721dd50 100644
--- a/src/userdb/userdbctl.c
+++ b/src/userdb/userdbctl.c
@@ -10,6 +10,7 @@
#include "format-util.h"
#include "main-func.h"
#include "pager.h"
+#include "parse-argument.h"
#include "parse-util.h"
#include "pretty-print.h"
#include "socket-util.h"
@@ -720,17 +721,17 @@ static int parse_argv(int argc, char *argv[]) {
break;
case ARG_WITH_NSS:
- r = parse_boolean(optarg);
+ r = parse_boolean_argument("--with-nss=", optarg, NULL);
if (r < 0)
- return log_error_errno(r, "Failed to parse --with-nss= parameter: %s", optarg);
+ return r;
SET_FLAG(arg_userdb_flags, USERDB_AVOID_NSS, !r);
break;
case ARG_SYNTHESIZE:
- r = parse_boolean(optarg);
+ r = parse_boolean_argument("--synthesize=", optarg, NULL);
if (r < 0)
- return log_error_errno(r, "Failed to parse --synthesize= parameter: %s", optarg);
+ return r;
SET_FLAG(arg_userdb_flags, USERDB_DONT_SYNTHESIZE, !r);
break;