tmpfiles: add --tldr

This is like --cat-config, but omits the comments and empty lines.
The name is incoungrous with --cat-config, but I don't see a nice way to
call it that wouldn't be annoyingly long.

pager_open() is moved to cat_config() to remove some lines from run().
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2023-10-24 18:32:17 +02:00
parent a9e6803582
commit 1be6a5db21
4 changed files with 33 additions and 14 deletions
+4 -2
View File
@@ -15,8 +15,10 @@ int terminal_urlify_path(const char *path, const char *text, char **ret);
int terminal_urlify_man(const char *page, const char *section, char **ret);
typedef enum CatFlags {
CAT_FORMAT_HAS_SECTIONS = 1 << 0, /* Sections are meaningful for this file format */
CAT_TLDR = 1 << 1, /* Only print comments and relevant section headers */
CAT_CONFIG_OFF = 0,
CAT_CONFIG_ON = 1 << 0,
CAT_FORMAT_HAS_SECTIONS = 1 << 1, /* Sections are meaningful for this file format */
CAT_TLDR = 1 << 2, /* Only print comments and relevant section headers */
} CatFlags;
int cat_files(const char *file, char **dropins, CatFlags flags);