[systemd-devel] [PATCH] inhibit: ellipsize WHAT

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Thu Nov 15 02:36:56 PST 2012


On Sat, Nov 10, 2012 at 09:37:38PM +0000, Shawn Landden wrote:
> +                ewhat= ellipsize(what,21, 66);

Hi,

I think that your patch goes in the right direction, but we should
look at the history that systemctl underwent in its output and learn
from that. Fixed sizes are always going to suck in case of multiple
columns of unpredictable width. systemctl first queries dbus and
stores everything in a list of ad-hoc struct unit_info, checks the
maximum size and then divides available columns smartly. I think doing
that in case of inhibit would be much better than ellipsizing.

Also, inhibit could skip headers if there are no inhibitors...

Also, in your patch, _cleanup_free_ could be used to shave off a few
lines.

Zbyszek



More information about the systemd-devel mailing list