From 8cfea8044ba69dffebb1ac8e0a8858d4c7dcc545 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Mon, 29 Sep 2014 02:09:10 -0700 Subject: [PATCH] help: make tg help tg work Make `tg help tg` show the README since that has the entire overview and summary of each command. Also arrange to install the README file as tg-tg.txt in the same location as the other help files. --- Makefile | 1 + tg.sh | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 00eff62..8ea6a66 100644 --- a/Makefile +++ b/Makefile @@ -57,6 +57,7 @@ install:: all install $(hooks_out) "$(DESTDIR)$(hooksdir)" install -d -m 755 "$(DESTDIR)$(sharedir)" install -m 644 $(help_out) "$(DESTDIR)$(sharedir)" + install -m 644 README "$(DESTDIR)$(sharedir)/tg-tg.txt" install -m 644 leaves.awk "$(DESTDIR)$(sharedir)" clean:: diff --git a/tg.sh b/tg.sh index 4546464..3a0f158 100644 --- a/tg.sh +++ b/tg.sh @@ -433,13 +433,16 @@ do_help() sep="|" done - echo "TopGit v$TG_VERSION - A different patch queue manager" + echo "TopGit version $TG_VERSION - A different patch queue manager" echo "Usage: tg ( help [] | [-r ] ($cmds) ...)" - elif [ -r "@cmddir@"/tg-$1 ] ; then + echo "Use \"tg help tg\" for overview of TopGit" + elif [ -r "@cmddir@"/tg-$1 -o -r "@sharedir@/tg-$1.txt" ] ; then setup_pager { - "@cmddir@"/tg-$1 -h 2>&1 || : - echo + if [ -r "@cmddir@"/tg-$1 ] ; then + "@cmddir@"/tg-$1 -h 2>&1 || : + echo + fi if [ -r "@sharedir@/tg-$1.txt" ] ; then cat "@sharedir@/tg-$1.txt" fi -- 2.11.4.GIT