From 992a145afd7bec1b18d356909392d5c6bf20add5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 30 Jan 2009 18:16:59 +0100 Subject: Automatically displaying manpage when calling a helper with -h or --help. --- functions/arguments.sh | 2 +- functions/man.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 functions/man.sh (limited to 'functions') diff --git a/functions/arguments.sh b/functions/arguments.sh index b2e4c92d7..bbc439c84 100755 --- a/functions/arguments.sh +++ b/functions/arguments.sh @@ -43,7 +43,7 @@ Arguments () ;; -h|--help) - Help + Man shift ;; diff --git a/functions/man.sh b/functions/man.sh new file mode 100755 index 000000000..72213e2f8 --- /dev/null +++ b/functions/man.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# man.sh - print man information +# Copyright (C) 2006-2009 Daniel Baumann +# +# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING. +# This is free software, and you are welcome to redistribute it +# under certain conditions; see COPYING for details. + +Man () +{ + if [ -x "$(which man 2>/dev/null)" ] + then + man $(basename ${0}) + exit 0 + fi +} -- cgit v1.2.3