#!/bin/bash

#------------------------------------------------------------------------------
# SCRIPT_NAME='ncl_man'
# VERSION=1.0
#------------------------------------------------------------------------------
# Comments to:
#   support@novell.com
#------------------------------------------------------------------------------
# Copyright 2009, Novell, Inc.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# This script and its embedded programs are distributed with
# absolutely, positively NO WARRANTY WHATSOEVER, without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE.  The author and Novell, Inc. take no responsibility for
# the consequences of running this script.
#------------------------------------------------------------------------------

NOVELL_MAN_DIR=/opt/novell/man

# setting up MANPATH variable
if [ -z `/bin/echo $MANPATH | /usr/bin/grep "$NOVELL_MAN_DIR" > /dev/null` ]
then
    export MANPATH=$MANPATH:$NOVELL_MAN_DIR
fi

if [ -z $1 ]
then
    MAN_DIRS=`/bin/ls $NOVELL_MAN_DIR`
    for MAN_DIR in $MAN_DIRS
    do 
        /bin/ls $NOVELL_MAN_DIR/$MAN_DIR -1
    done
else
    /usr/bin/man $*
fi

