Make "Man" function smarter to also work for "lb --help"

This commit is contained in:
Raphaël Hertzog 2020-04-24 16:38:45 +02:00
parent 55d9b213cf
commit fac2d8d903
1 changed files with 14 additions and 2 deletions

View File

@ -11,9 +11,21 @@
Man ()
{
local BASENAME
BASENAME=$(basename ${0})
if [ $(which man) ]
then
man ${PROGRAM} $(basename ${0})
exit 0
case $BASENAME in
$PROGRAM)
man ${PROGRAM}
;;
*)
man ${PROGRAM} $(basename ${0})
;;
esac
else
Echo_warning "man is not installed, falling back to usage output."
Usage
fi
exit 0
}