tree-wide: add a helper to parse boolean optarg
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 15 Feb 2021 18:32:42 +0000 (19:32 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 17 Feb 2021 20:06:31 +0000 (21:06 +0100)
commit599c7c545f689f7d19a73238eecc69bf94fa6a74
tree3d7cc8218ea1771ada8c36d094cda46a51c81291
parent79dbbb261d245b619a4d82c1cdf96f6a4310ee0d
tree-wide: add a helper to parse boolean optarg

This nicely covers the case when optarg is optional. The same parser can be
used when the option string passed to getopt_long() requires a parameter and
when it doesn't.

The error messages are made consistent.
Also fixes a log error c&p in --crash-reboot message.
src/analyze/analyze.c
src/busctl/busctl.c
src/cgtop/cgtop.c
src/core/main.c
src/journal/cat.c
src/mount/mount-tool.c
src/partition/repart.c
src/resolve/resolvectl.c
src/shared/parse-argument.c
src/shared/parse-argument.h