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.
This commit is contained in:
@@ -288,9 +288,9 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
break;
|
||||
|
||||
case ARG_AUTOMOUNT:
|
||||
r = parse_boolean(optarg);
|
||||
r = parse_boolean_argument("--automount=", optarg, NULL);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "--automount= expects a valid boolean parameter: %s", optarg);
|
||||
return r;
|
||||
|
||||
arg_action = r ? ACTION_AUTOMOUNT : ACTION_MOUNT;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user