diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-02-25 15:29:59 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-02-25 15:29:59 -0500 |
commit | 06fb28b16eb4b6170c2e2c0cf1f673730309509b (patch) | |
tree | 785adf7225d02701b4b0418c61ef0c0c3a24848b /src/core | |
parent | 8984d7bb5cc1d34cae4ec31696974a9e9f0dca44 (diff) | |
parent | ea4b98e6577ad4311e4eb4d2384c82f0d870b5ba (diff) |
Merge pull request #2671 from 0xAX/move-pager-open-to-one-place
tree-wide: merge pager_open_if_enabled() to the pager_open()
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/main.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/core/main.c b/src/core/main.c index ac4fd87585..b4e96fd6f4 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -102,7 +102,7 @@ static bool arg_crash_reboot = false; static bool arg_confirm_spawn = false; static ShowStatus arg_show_status = _SHOW_STATUS_UNSET; static bool arg_switched_root = false; -static int arg_no_pager = -1; +static bool arg_no_pager = false; static char ***arg_join_controllers = NULL; static ExecOutput arg_default_std_output = EXEC_OUTPUT_JOURNAL; static ExecOutput arg_default_std_error = EXEC_OUTPUT_INHERIT; @@ -127,14 +127,6 @@ static bool arg_default_tasks_accounting = true; static uint64_t arg_default_tasks_max = UINT64_C(512); static sd_id128_t arg_machine_id = {}; -static void pager_open_if_enabled(void) { - - if (arg_no_pager <= 0) - return; - - pager_open(false); -} - noreturn static void freeze_or_reboot(void) { if (arg_crash_reboot) { @@ -883,8 +875,6 @@ static int parse_argv(int argc, char *argv[]) { case ARG_TEST: arg_action = ACTION_TEST; - if (arg_no_pager < 0) - arg_no_pager = true; break; case ARG_NO_PAGER: @@ -994,8 +984,6 @@ static int parse_argv(int argc, char *argv[]) { case 'h': arg_action = ACTION_HELP; - if (arg_no_pager < 0) - arg_no_pager = true; break; case 'D': @@ -1548,7 +1536,8 @@ int main(int argc, char *argv[]) { if (arg_action == ACTION_TEST) skip_setup = true; - pager_open_if_enabled(); + if (arg_action == ACTION_TEST || arg_action == ACTION_HELP) + pager_open(arg_no_pager, false); if (arg_action == ACTION_HELP) { retval = help(); |