return;
}
- if (!strv_isempty(l))
- printf("%s/\n", prefix);
+ if (strv_isempty(l)) {
+ printf("No objects discovered.\n");
+ return;
+ }
+
+ if (streq(l[0], "/") && !l[1]) {
+ printf("Only root object discovered.\n");
+ return;
+ }
print_subtree(prefix, "/", l);
}
if (strv_length(argv) <= 1) {
_cleanup_strv_free_ char **names = NULL;
- bool not_first = true;
+ bool not_first = false;
r = sd_bus_list_names(bus, &names, NULL);
if (r < 0) {
if (not_first)
printf("\n");
- printf("Service %s:\n", *i);
+ printf("Service %s%s%s:\n", ansi_highlight(), *i, ansi_highlight_off());
- q = tree_one(bus, *i, "\t");
+ q = tree_one(bus, *i, NULL);
if (q < 0 && r >= 0)
r = q;
printf("\n");
if (argv[2])
- printf("Service %s:\n", *i);
+ printf("Service %s%s%s:\n", ansi_highlight(), *i, ansi_highlight_off());
q = tree_one(bus, *i, NULL);
if (q < 0 && r >= 0)