From 49dbfa7b2b0bf3906704dac1eaeb4eba91056a19 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 21 May 2012 15:12:18 +0200 Subject: units: introduce new Documentation= field and make use of it everywhere This should help making the boot process a bit easier to explore and understand for the administrator. The simple idea is that "systemctl status" now shows a link to documentation alongside the other status and decriptionary information of a service. This patch adds the necessary fields to all our shipped units if we have proper documentation for them. --- src/shared/util.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/shared/util.c') diff --git a/src/shared/util.c b/src/shared/util.c index 0b81e1c4f9..ae0ce320ad 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -5610,3 +5610,24 @@ int can_sleep(const char *type) { free(p); return found; } + +bool is_valid_documentation_url(const char *url) { + assert(url); + + if (startswith(url, "http://") && url[7]) + return true; + + if (startswith(url, "https://") && url[8]) + return true; + + if (startswith(url, "file:") && url[5]) + return true; + + if (startswith(url, "info:") && url[5]) + return true; + + if (startswith(url, "man:") && url[4]) + return true; + + return false; +} -- cgit v1.2.3-54-g00ecf