summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Hertzog <hertzog@debian.org>2020-04-24 16:38:45 +0200
committerRaphaël Hertzog <hertzog@debian.org>2020-04-24 16:38:45 +0200
commitfac2d8d903330e1ae255803cd2bb1041197a9f71 (patch)
tree093a4780d6519f2e643c604b6a39053fa816cb92
parent55d9b213cfaa55f6be0ce9d803e3603dfbf87dd7 (diff)
downloadvyos-live-build-fac2d8d903330e1ae255803cd2bb1041197a9f71.tar.gz
vyos-live-build-fac2d8d903330e1ae255803cd2bb1041197a9f71.zip
Make "Man" function smarter to also work for "lb --help"
-rwxr-xr-xfunctions/man.sh16
1 files changed, 14 insertions, 2 deletions
diff --git a/functions/man.sh b/functions/man.sh
index 06b51a7d4..d5cdbb31b 100755
--- a/functions/man.sh
+++ b/functions/man.sh
@@ -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
}