}
static void show_unit_help(UnitStatusInfo *i) {
+ bool previous_man_page = false;
+
assert(i);
if (!i->documentation) {
return;
}
- STRV_FOREACH(p, i->documentation)
- if (startswith(*p, "man:"))
- show_man_page(*p + 4, false);
- else
- log_info("Can't show: %s", *p);
+ STRV_FOREACH(doc, i->documentation) {
+ const char *p;
+
+ p = startswith(*doc, "man:");
+
+ if (p ? doc != i->documentation : previous_man_page) {
+ puts("");
+ fflush(stdout);
+ }
+
+ previous_man_page = p;
+
+ if (p)
+ show_man_page(p, /* null_stdio= */ false);
+ else {
+ _cleanup_free_ char *t = NULL;
+
+ if ((p = startswith(*doc, "file://")))
+ (void) terminal_urlify_path(p, NULL, &t);
+
+ printf("Additional documentation: %s\n", t ?: p ?: *doc);
+ }
+ }
}
static int map_main_pid(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_error *error, void *userdata) {