systemctl: format documentation links in status output as clickable links

This commit is contained in:
Lennart Poettering
2018-04-19 18:04:26 +02:00
parent 87adb0db27
commit 78c7d20ebc
+11 -2
View File
@@ -4143,8 +4143,17 @@ static void print_status_info(
if (i->what)
printf(" What: %s\n", i->what);
STRV_FOREACH(t, i->documentation)
printf(" %*s %s\n", 9, t == i->documentation ? "Docs:" : "", *t);
STRV_FOREACH(t, i->documentation) {
_cleanup_free_ char *formatted = NULL;
const char *q;
if (terminal_urlify(*t, NULL, &formatted) >= 0)
q = formatted;
else
q = *t;
printf(" %*s %s\n", 9, t == i->documentation ? "Docs:" : "", q);
}
STRV_FOREACH_PAIR(t, t2, i->listen)
printf(" %*s %s (%s)\n", 9, t == i->listen ? "Listen:" : "", *t2, *t);