summaryrefslogtreecommitdiffstats
path: root/src/delta
diff options
context:
space:
mode:
authorAlexander Kuleshov <kuleshovmail@gmail.com>2016-02-19 19:25:13 +0100
committerAlexander Kuleshov <kuleshovmail@gmail.com>2016-02-25 20:13:23 +0100
commitea4b98e6577ad4311e4eb4d2384c82f0d870b5ba (patch)
tree74820b01e48c222774c3884adc1ae73d39acb49e /src/delta
parentMerge pull request #2707 from teg/man-network (diff)
downloadsystemd-ea4b98e6577ad4311e4eb4d2384c82f0d870b5ba.tar.xz
systemd-ea4b98e6577ad4311e4eb4d2384c82f0d870b5ba.zip
tree-wide: merge pager_open_if_enabled() to the pager_open()
Many subsystems define own pager_open_if_enabled() function which checks '--no-pager' command line argument and open pager depends on its value. All implementations of pager_open_if_enabled() are the same. Let's merger this function with pager_open() from the shared/pager.c and remove pager_open_if_enabled() from all subsytems to prevent code duplication.
Diffstat (limited to 'src/delta')
-rw-r--r--src/delta/delta.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/delta/delta.c b/src/delta/delta.c
index a54fc89de6..b055075e55 100644
--- a/src/delta/delta.c
+++ b/src/delta/delta.c
@@ -85,14 +85,6 @@ static enum {
(SHOW_MASKED | SHOW_EQUIVALENT | SHOW_REDIRECTED | SHOW_OVERRIDDEN | SHOW_EXTENDED)
} arg_flags = 0;
-static void pager_open_if_enabled(void) {
-
- if (arg_no_pager)
- return;
-
- pager_open(false);
-}
-
static int equivalent(const char *a, const char *b) {
_cleanup_free_ char *x = NULL, *y = NULL;
@@ -610,7 +602,7 @@ int main(int argc, char *argv[]) {
else if (arg_diff)
arg_flags |= SHOW_OVERRIDDEN;
- pager_open_if_enabled();
+ pager_open(arg_no_pager, false);
if (optind < argc) {
int i;