machinectl: tweak address output in "machinectl status"
authorLennart Poettering <lennart@poettering.net>
Mon, 13 Feb 2017 16:23:58 +0000 (17:23 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 17 Feb 2017 09:22:28 +0000 (10:22 +0100)
commit7026a775e656bb9cd982fd450e3d9c60d62a0bdf
tree39e9472b1d83142ea08437cc7213d85c752b5de6
parent3401419bb8215612cf8db33d930a64a54b19dcb3
machinectl: tweak address output in "machinectl status"

With this change we'll not show an "Addresses" field for machines that
we don't know any addresses for.

This changes print_addresses() to never suffix its output with a
newline, leaving that to the caller. That's a good idea since depending
on who the caller is, different rules apply: if no addresses are found,
then the list view still wants a newline, but the status view does not.

This also changes the function to return the number of found addresses,
which can be used to decide when to add a newline or not.
src/machine/machinectl.c