[TopGit PATCH] Print help message when command is not proper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When invoked with an unknown subcommand, or when --help is sought for
a command that does not exist, TopGit prints the help message.

Signed-off-by: martin f. krafft <madduck@xxxxxxxxxx>

---
 tg.sh |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/tg.sh b/tg.sh
index 4dcc15e..2464612 100644
--- a/tg.sh
+++ b/tg.sh
@@ -232,6 +232,8 @@ do_help()
 		fi
 	else
 		echo "`basename $0`: no help for $1" 1>&2
+		do_help
+		exit 1
 	fi
 }
 
@@ -279,6 +281,7 @@ help|--help|-h)
 *)
 	[ -r "@cmddir@"/tg-$cmd ] || {
 		echo "Unknown subcommand: $cmd" >&2
+		do_help
 		exit 1
 	}
 	. "@cmddir@"/tg-$cmd;;
-- 
tg: (f17218e..) fixes/more-help (depends on: upstream)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux