#!/bin/sh
# Copyright 2009-2011 Gentoo Authors
# Distributed under the terms of the MIT/X11 license

# Wrapper script, executes ${PAGER} with arguments $@

if [ -z "${PAGER}" ]; then
    # Try to get PAGER from system profile
    PAGER=$(. /etc/profile >/dev/null 2>&1; echo "${PAGER}")
fi

if [ -z "${PAGER}" ]; then
    echo "$0: The PAGER variable must be set" >&2
    exit 1
fi

exec ${PAGER} "$@"
