Skip to contentSkip to conversation

guilt-help: Make guilt-cmd --help show the right man page

PATCH New Eric Lesh 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore

Eric Lesh

author
#0 lore raw

PATCH 1/1 guilt-help: Make guilt-cmd --help show the right man page

---
 guilt      |    8 +++++++-
 guilt-help |    3 ++-
 2 files changed, 9 insertions(+), 2 deletions(-)
guilt +7 -1
index f67bfb5..6a69261 100755
@@ -11,7 +11,13 @@ GUILT_NAME="Los"
 case $1 in
 	-h|--h|--he|--hel|--help)
 	shift
-	exec "guilt-help" "$@"
+        if [ -z "$@" ]; then
+		# guilt-cmd --help or guilt cmd --help
+		exec "guilt-help" `basename $0`
+	else
+		# guilt --help cmd
+		exec "guilt-help" "$@"
+	fi
 	exit
 	;;
 	-V|--ver|--versi|--versio|--version)
guilt-help +2 -1
index 274246b..e2340d9 100755
@@ -14,7 +14,8 @@ case $# in
 		;;
 	1)
 		if [ "$1" != "guilt" ]; then
-			page="guilt-$1"
+			cmd=$(echo "$1" | sed -e 's/guilt-//')
+			page="guilt-$cmd"
 		else
 			page="guilt"
 		fi
Signature · 1 line
1.5.2