basic/pager: convert the pager options to a flags argument

Pretty much everything uses just the first argument, and this doesn't make this
common pattern more complicated, but makes it simpler to pass multiple options.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2018-11-14 16:25:11 +01:00
parent 8e143a1232
commit 0221d68a13
25 changed files with 127 additions and 122 deletions
+3 -3
View File
@@ -62,7 +62,7 @@ static char *arg_root = NULL;
static bool arg_cat_config = false;
static const char *arg_replace = NULL;
static bool arg_inline = false;
static bool arg_no_pager = false;
static PagerFlags arg_pager_flags = 0;
static OrderedHashmap *users = NULL, *groups = NULL;
static OrderedHashmap *todo_uids = NULL, *todo_gids = NULL;
@@ -1760,7 +1760,7 @@ static int cat_config(void) {
if (r < 0)
return r;
(void) pager_open(arg_no_pager, false);
(void) pager_open(arg_pager_flags);
return cat_files(NULL, files, 0);
}
@@ -1852,7 +1852,7 @@ static int parse_argv(int argc, char *argv[]) {
break;
case ARG_NO_PAGER:
arg_no_pager = true;
arg_pager_flags |= PAGER_DISABLE;
break;
case '?':