]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
busctl: Add space before "tree" paths for copying
authorMatt Johnston <matt@ucc.asn.au>
Thu, 18 May 2023 04:28:06 +0000 (12:28 +0800)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 18 May 2023 08:55:03 +0000 (17:55 +0900)
This allows a double-click on the path in a terminal to select the
whole path. Otherwise the leading '-' character is also included in
the copied path.

```
New output:
./busctl tree org.freedesktop.network1
`- /org
  `- /org/freedesktop
    |- /org/freedesktop/LogControl1
    `- /org/freedesktop/network1
      |- /org/freedesktop/network1/link
      | |- /org/freedesktop/network1/link/_31
      | |- /org/freedesktop/network1/link/_32
```

src/busctl/busctl.c

index 820d27da20dbe7b9e2ff847f8abb7d045c219e76..965ded9675ecb57767fb081fb70179507b739cf8 100644 (file)
@@ -407,7 +407,7 @@ static void print_subtree(const char *prefix, const char *path, char **l) {
                         n++;
                 }
 
-                printf("%s%s%s\n",
+                printf("%s%s %s\n",
                        prefix,
                        special_glyph(has_more ? SPECIAL_GLYPH_TREE_BRANCH : SPECIAL_GLYPH_TREE_RIGHT),
                        *l);