Added configure option to specify the default pager for occtl.

This commit is contained in:
Nikos Mavrogiannopoulos
2014-01-11 21:21:18 +01:00
parent ea45e710d0
commit 3ccd12673a
2 changed files with 10 additions and 3 deletions
+9
View File
@@ -155,6 +155,15 @@ if [ test "$anyconnect_enabled" = "yes" ];then
AC_DEFINE([ANYCONNECT_CLIENT_COMPAT], [], [Enable Anyconnect compatibility])
fi
AC_ARG_WITH(pager,
AS_HELP_STRING([--with-pager], [set a specific pager for occtl]),
occtl_pager=$withval)
if [ test -z "$occtl_pager" ];then
AC_DEFINE([OCCTL_PAGER], [less], [The default pager for occtl])
else
AC_DEFINE_UNQUOTED([OCCTL_PAGER], ["$occtl_pager"], [The default pager for occtl])
fi
dnl Test for http_parser library
with_local_http_parser=yes
LIBS="$oldlibs -lhttp_parser"
+1 -3
View File
@@ -26,8 +26,6 @@
#include <unistd.h>
#include <occtl.h>
#define DEFAULT_PAGER "less"
static const char* get_pager(void)
{
char* pager;
@@ -35,7 +33,7 @@ char* pager;
if (pager == NULL)
pager = getenv("PAGER");
if (pager == NULL)
pager = DEFAULT_PAGER;
pager = OCCTL_PAGER;
return pager;
}