summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-07-29 11:40:30 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-07-29 16:08:18 +0200
commit49139a5d927676f938c466610edb0c5d5c6e82c6 (patch)
tree7a69c583e4a74e581b9dc9d638108e6028bc6211
parentdf38212dd1af342321257188ee63738c82b6392a (diff)
downloadsystemd-49139a5d927676f938c466610edb0c5d5c6e82c6.tar.gz
analyze: dot(1) man page link should be urlified
I mean, let's not miss out on this excellent opportunity to use hyperlinks on terminals. (Unfortunately not see unless you invoke 'systemd-analyze --no-pager --help', because 'less' is so much stuck in the past :-(.)
-rw-r--r--src/analyze/analyze.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
index 92727974d6..384924ed34 100644
--- a/src/analyze/analyze.c
+++ b/src/analyze/analyze.c
@@ -2126,7 +2126,7 @@ static int do_security(int argc, char *argv[], void *userdata) {
}
static int help(int argc, char *argv[], void *userdata) {
- _cleanup_free_ char *link = NULL;
+ _cleanup_free_ char *link = NULL, *dot_link = NULL;
int r;
(void) pager_open(arg_pager_flags);
@@ -2135,6 +2135,11 @@ static int help(int argc, char *argv[], void *userdata) {
if (r < 0)
return log_oom();
+ /* Not using terminal_urlify_man() for this, since we don't want the "man page" text suffix in this case. */
+ r = terminal_urlify("man:dot(1)", "dot(1)", &dot_link);
+ if (r < 0)
+ return log_oom();
+
printf("%s [OPTIONS...] {COMMAND} ...\n\n"
"Profile systemd, show unit dependencies, check unit files.\n\n"
" -h --help Show this help\n"
@@ -2159,7 +2164,7 @@ static int help(int argc, char *argv[], void *userdata) {
" blame Print list of running units ordered by time to init\n"
" critical-chain [UNIT...] Print a tree of the time critical chain of units\n"
" plot Output SVG graphic showing service initialization\n"
- " dot [UNIT...] Output dependency graph in man:dot(1) format\n"
+ " dot [UNIT...] Output dependency graph in %s format\n"
" log-level [LEVEL] Get/set logging threshold for manager\n"
" log-target [TARGET] Get/set logging target for manager\n"
" dump Output state serialization of service manager\n"
@@ -2175,6 +2180,7 @@ static int help(int argc, char *argv[], void *userdata) {
" security [UNIT...] Analyze security of unit\n"
"\nSee the %s for details.\n"
, program_invocation_short_name
+ , dot_link
, link
);