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.
This commit is contained in:
@@ -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/");
|
||||
|
||||
Reference in New Issue
Block a user