]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Add meson option to disable urlify.
authorJames Hilliard <james.hilliard1@gmail.com>
Sun, 11 Jul 2021 10:39:33 +0000 (04:39 -0600)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 19 Jul 2021 09:57:51 +0000 (11:57 +0200)
Useful for systems that don't use a version of less with hyperlink
support.

meson.build
meson_options.txt
src/shared/pretty-print.c

index 5735cfc7ada0eaba0bfd52d7670836ed046e2886..a2ee15bf3205ea2e9f675d2fdbe28c78c6c7f6f5 100644 (file)
@@ -278,6 +278,7 @@ conf.set_quoted('USER_PRESET_DIR',                            userpresetdir)
 conf.set_quoted('VENDOR_KEYRING_PATH',                        join_paths(rootlibexecdir, 'import-pubring.gpg'))
 
 conf.set('ANSI_OK_COLOR',                                     'ANSI_' + get_option('ok-color').underscorify().to_upper())
+conf.set10('ENABLE_URLIFY',                                   get_option('urlify'))
 conf.set10('ENABLE_FEXECVE',                                  get_option('fexecve'))
 conf.set10('MEMORY_ACCOUNTING_DEFAULT',                       memory_accounting_default)
 conf.set('STATUS_UNIT_FORMAT_DEFAULT',                        'STATUS_UNIT_FORMAT_' + status_unit_format_default.to_upper())
index 163c8df87db56b90637221656d0ac01b13f3fbd7..b60261ac24e64154569d2e4295974d97636414a5 100644 (file)
@@ -444,6 +444,8 @@ option('ok-color', type : 'combo',
                   'highlight-cyan', 'highlight-white'],
        value : 'green',
        description: 'color of the "OK" status message')
+option('urlify', type : 'boolean', value : 'true',
+       description : 'enable pager Hyperlink ANSI sequence support')
 option('fexecve', type : 'boolean', value : 'false',
        description : 'use fexecve() to spawn children')
 
index 137ba77b3a6ea700396cce26608e02f230ee7734..7983c0a33afc7ed3d05d1d0d24716564280b85c8 100644 (file)
@@ -19,6 +19,7 @@
 #include "util.h"
 
 bool urlify_enabled(void) {
+#if ENABLE_URLIFY
         static int cached_urlify_enabled = -1;
 
         if (cached_urlify_enabled < 0) {
@@ -32,6 +33,9 @@ bool urlify_enabled(void) {
         }
 
         return cached_urlify_enabled;
+#else
+        return 0;
+#endif
 }
 
 int terminal_urlify(const char *url, const char *text, char **ret) {