chiark / gitweb /
tg help: <something>: improve readability
authorKirill Smelkov <kirr@landau.phys.spbu.ru>
Thu, 18 Sep 2008 16:29:29 +0000 (20:29 +0400)
committerPetr Baudis <pasky@suse.cz>
Mon, 22 Sep 2008 15:40:35 +0000 (17:40 +0200)
Previously tg help was not showing Usage line, and with this change, now it
looks like e.g.:

$ tg help import
Usage: tg [...] import [-p PREFIX] RANGE...

        Import commits within the given revision range into TopGit,
        creating one topic branch per commit, the dependencies forming
        a linear sequence starting on your current branch.

        The branch names are auto-guessed from the commit messages
        and prefixed by t/ by default; use '-p PREFIX' to specify
        an alternative prefix (even an empty one).

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
tg.sh

diff --git a/tg.sh b/tg.sh
index 545e1b8ec3d228cc2569090e651793dc45b77397..08975aef00d6b71a79c5cbdd4d1baa6aa2df0159 100644 (file)
--- a/tg.sh
+++ b/tg.sh
@@ -224,8 +224,12 @@ do_help()
 
                echo "TopGit v0.3 - A different patch queue manager"
                echo "Usage: tg [-r REMOTE] ($cmds|help) ..."
 
                echo "TopGit v0.3 - A different patch queue manager"
                echo "Usage: tg [-r REMOTE] ($cmds|help) ..."
-       elif [ -r "@sharedir@/tg-$1.txt" ] ; then
-               cat "@sharedir@/tg-$1.txt"
+       elif [ -r "@cmddir@"/tg-$1 ] ; then
+               @cmddir@/tg-$1 -h || :
+               echo
+               if [ -r "@sharedir@/tg-$1.txt" ] ; then
+                       cat "@sharedir@/tg-$1.txt"
+               fi
        else
                echo "`basename $0`: no help for $1" 1>&2
        fi
        else
                echo "`basename $0`: no help for $1" 1>&2
        fi