From 2e1ec10a62e57551e3ee17606df488816e945b49 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 27 Apr 2018 09:55:32 +0200 Subject: [PATCH] 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. --- src/analyze/analyze.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index 19e6e83c6f..b6036acf1c 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/"); -- 2.25.1