]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/udev/udevadm-info.c
udevadm: improve error output when a device is not specified or specified wrong
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 10 Dec 2018 10:06:27 +0000 (11:06 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 11 Dec 2018 06:29:51 +0000 (07:29 +0100)
commit668e7c0cfdf8cfe0bf545507e8c6bc54e44cbc97
treea687c31c426369993a3f5406828d795dd6fb57bd
parent5fe7a0a7de9027bbae1a20738da613d6591feec8
udevadm: improve error output when a device is not specified or specified wrong

udevadm would dump help() output, instead of printing a message about what is
wrong. That's just bad UX. Let's use a different message if the argument is
missing, and a different one if it is invalid.

Also, rework the code to separate the business logic from argument parsing.
Let's not use "default:" in switch statements. This way, the compiler will warn
us if we miss one of the cases.
src/udev/udevadm-info.c