busctl: verify args early and always print results to stdout
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 24 May 2020 11:47:53 +0000 (13:47 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 26 May 2020 07:07:27 +0000 (09:07 +0200)
commit50f20d1bc2211a0e769278471aac108aa79ab26e
tree005f703934cab1cc03a9fdd79862bff5e4ba97b7
parent062ac2ea85e466105c6aca4ea95e1d9a17422cea
busctl: verify args early and always print results to stdout

We would print the error sometimes to stdout and sometimes to stderr. It *is*
useful to get the message if one of the names is not found on the bus to
stdout, so that this shows out in the pager. So let's do verification of args
early to catch invalid arguments, and then if we receive an error over the bus
(most likely that the name is not activatable), let's print to stdout so it
gets paged. E.g. 'busctl tree org.freedesktop.systemd1 org.freedesktop.systemd2'
gives a nicely usable output.
TODO
src/busctl/busctl.c