parse-argument: make parse_tristate_argument() do something useful
I expressed the issue I have with parse_tristate_argument() in #37751: it doesn't add any value to direct use of parse_tristate(); on the contrary, it doesn't support means to reset the arg to "auto"/-1 state. The mere reason it existed is that we need a int type ret param. Since the previous attempt to address this mess failed, let's try to make the function more useful by making it accept "auto". I figure this is useful on its own. As requested in https://github.com/systemd/systemd/pull/40652#discussion_r2831833996, the function name is suffixed with _with_auto() to establish that "auto" is handled internally.
This commit is contained in:
@@ -521,7 +521,7 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
break;
|
||||
|
||||
case ARG_VARIABLES:
|
||||
r = parse_tristate_argument("--variables=", optarg, &arg_touch_variables);
|
||||
r = parse_tristate_argument_with_auto("--variables=", optarg, &arg_touch_variables);
|
||||
if (r < 0)
|
||||
return r;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user