From: Lennart Poettering Date: Mon, 7 May 2018 19:18:25 +0000 (+0200) Subject: nspawn: show --help text in a pager X-Git-Tag: v239~243^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=50ebcf6cb79f709cc08c8a797df128a4a79fc8fd;p=thirdparty%2Fsystemd.git nspawn: show --help text in a pager The text is long enough now, and we do auto-paging for systemctl already, hence let's do it here too. --- diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 21d63987ec9..517c750eca6 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -75,6 +75,7 @@ #include "nspawn-settings.h" #include "nspawn-setuid.h" #include "nspawn-stub-pid1.h" +#include "pager.h" #include "parse-util.h" #include "path-util.h" #include "process-util.h" @@ -208,6 +209,9 @@ static int arg_oom_score_adjust = 0; static bool arg_oom_score_adjust_set = false; static void help(void) { + + (void) pager_open(false, false); + printf("%s [OPTIONS...] [PATH] [ARGUMENTS...]\n\n" "Spawn a minimal namespace container for debugging, testing and building.\n\n" " -h --help Show this help\n" @@ -4318,6 +4322,8 @@ finish: if (pid > 0) (void) wait_for_terminate(pid, NULL); + pager_close(); + if (remove_directory && arg_directory) { int k;