]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: show --help text in a pager
authorLennart Poettering <lennart@poettering.net>
Mon, 7 May 2018 19:18:25 +0000 (21:18 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 17 May 2018 18:48:13 +0000 (20:48 +0200)
The text is long enough now, and we do auto-paging for systemctl
already, hence let's do it here too.

src/nspawn/nspawn.c

index 21d63987ec9c20bd54919cfaac9dfc078f27270e..517c750eca61717c91648adfbb822864ce97e5d4 100644 (file)
@@ -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;