]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev: implement --version in all builtins
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 13 Mar 2023 17:12:04 +0000 (18:12 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 16 Mar 2023 15:46:44 +0000 (16:46 +0100)
commit5356761da67aa5c11f784c3ba9ac8d8f6e55048b
tree970588a1d900622bc063c410f42ae905de55db3c
parentbd36d0281ab41bfea932931e913809ee1e6195ed
udev: implement --version in all builtins

Those are separate binaries, and occasionally people will get a misplaced
binary that doesn't match the rest of the installed system and be confused, so
it good to be able to check the version. It is also nice to have the same
interface in all binaries.

Note that we usually use a separate 'enum ARG_VERSION = 0x100' for an option
without a short name. We can use a less verbose approach of simply taking any
unused letter, which works just as well and even the compiler would warn us
if we tried to use the letter in another place. This way we avoid a few lines
of boilerplate.

The help texts are adjusted to have an empty line between the synopsis and
option list, and no empty lines after the option list.
man/udevadm.xml
src/udev/ata_id/ata_id.c
src/udev/cdrom_id/cdrom_id.c
src/udev/dmi_memory_id/dmi_memory_id.c
src/udev/fido_id/fido_id.c
src/udev/mtd_probe/mtd_probe.c
src/udev/v4l_id/v4l_id.c