Git development
 help / color / mirror / Atom feed
* [TopGit PATCH] Print help message when command is not proper
@ 2008-11-20 12:08 martin f. krafft
  2008-11-20 13:18 ` Petr Baudis
  0 siblings, 1 reply; 2+ messages in thread
From: martin f. krafft @ 2008-11-20 12:08 UTC (permalink / raw)
  To: git, pasky; +Cc: martin f. krafft

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@debian.org>

---
 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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [TopGit PATCH] Print help message when command is not proper
  2008-11-20 12:08 [TopGit PATCH] Print help message when command is not proper martin f. krafft
@ 2008-11-20 13:18 ` Petr Baudis
  0 siblings, 0 replies; 2+ messages in thread
From: Petr Baudis @ 2008-11-20 13:18 UTC (permalink / raw)
  To: martin f. krafft; +Cc: git

On Thu, Nov 20, 2008 at 01:08:48PM +0100, martin f. krafft wrote:
> 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@debian.org>

Acked-by: Petr Baudis <pasky@suse.cz>

Note that I think these changes are reasonable only as long as do_help
is just a short two-line usage help; in the event we also implement a
longer help, it certainly shouldn't be printed in these cases.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-11-20 13:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-20 12:08 [TopGit PATCH] Print help message when command is not proper martin f. krafft
2008-11-20 13:18 ` Petr Baudis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox