]> git.ipfire.org Git - thirdparty/systemd.git/commit
parse-argument: make parse_tristate_argument() do something useful
authorMike Yuan <me@yhndnzj.com>
Wed, 11 Feb 2026 22:15:24 +0000 (23:15 +0100)
committerMike Yuan <me@yhndnzj.com>
Fri, 20 Feb 2026 20:20:45 +0000 (21:20 +0100)
commit577e5e9a5e5a0076389f3b197d93e36da4abea06
treed1a6350b2a917e453c79af12568ff81e0689831d
parent774e8059590fac45614a135161dee4669945e342
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.
man/bootctl.xml
man/run0.xml
man/systemd-dissect.xml
src/bootctl/bootctl.c
src/dissect/dissect.c
src/run/run.c
src/shared/parse-argument.c
src/shared/parse-argument.h
src/systemctl/systemctl.c