From: Lennart Poettering Date: Tue, 12 Jun 2018 13:43:59 +0000 (+0200) Subject: terminal-util: make file names in --cat-config output clickable links X-Git-Tag: v239~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9539a9d3dbec4cc628584d7c279ffe110bf67ef7;p=platform%2Fupstream%2Fsystemd.git terminal-util: make file names in --cat-config output clickable links --- diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c index 8b1d2e5..234a172 100644 --- a/src/basic/terminal-util.c +++ b/src/basic/terminal-util.c @@ -1376,16 +1376,21 @@ int terminal_urlify_path(const char *path, const char *text, char **ret) { static int cat_file(const char *filename, bool newline) { _cleanup_fclose_ FILE *f = NULL; + _cleanup_free_ char *urlified = NULL; int r; f = fopen(filename, "re"); if (!f) return -errno; + r = terminal_urlify_path(filename, NULL, &urlified); + if (r < 0) + return r; + printf("%s%s# %s%s\n", newline ? "\n" : "", ansi_highlight_blue(), - filename, + urlified, ansi_normal()); fflush(stdout);