From: Zbigniew Jędrzejewski-Szmek Date: Fri, 27 Apr 2018 07:55:32 +0000 (+0200) Subject: analyze: seperate config file groups by underline X-Git-Tag: v239~281^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2e1ec10a62e57551e3ee17606df488816e945b49;p=thirdparty%2Fsystemd.git analyze: seperate config file groups by underline When multiple configuration file groups are shown together (e.g. systemd-analyze cat-config systemd/system.conf systemd/user.conf), it's nice to separate them visually. I tried first to write a line of spaces and underline that. This does not look too good, because the line is too low. Then I tried a block of blue-background spaces. In this version, there are two lines, one is full of spaces and underlined, so visually we get an empty line in the middle. I then tried underlining the last line of the previous file. This does not look right, unless the line is full width, i.e. unless spaces are written out until the end of the line. But when those spaces are added, it's not clear if they were part of the original file or not. Here, the spaces are between groups, so it seems less likely that somebody will mistake those spaces for part of the configuration file. --- diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index 19e6e83c6ff..b6036acf1c9 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -1323,7 +1323,10 @@ static int cat_config(int argc, char *argv[], void *userdata) { STRV_FOREACH(arg, argv + 1) { if (arg != argv + 1) - puts(""); + printf("%s%*s%s\n\n", + ansi_underline(), + columns(), "", + ansi_normal()); if (path_is_absolute(*arg)) { log_error("Arguments must be config file names (relative to /etc/");