gst-inspect: Use less -F -X everywhere as the pager
authorNirbheek Chauhan <nirbheek@centricular.com>
Thu, 22 Nov 2018 22:01:38 +0000 (03:31 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Fri, 23 Nov 2018 15:01:27 +0000 (20:31 +0530)
This emulates the default behaviour of git help pages, and also fixes
a bug on macOS where `less -F` doesn't display anything at all when
the output is shorter than one terminal screen.

Also moved the DEFAULT_PAGER define to after the includes, because
it's an unprefixed define.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/330

tools/gst-inspect.c

index c9f407a107b7a9fd88e4839f5a7d02f9e2eb292e..372f91a245c7ec8505d1bbe6efb220dab39e0c0f 100644 (file)
@@ -29,8 +29,6 @@
  * with newer GLib versions (>= 2.31.0) */
 #define GLIB_DISABLE_DEPRECATION_WARNINGS
 
-#define DEFAULT_PAGER "less -F"
-
 #include "tools.h"
 #include <gst/gst_private.h>    /* for internal Factories */
 
@@ -42,6 +40,8 @@
 #   include <sys/wait.h>
 #endif
 
+#define DEFAULT_PAGER "less -F -X"
+
 static char *_name = NULL;
 static int indent = 0;