git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
MKmartin f. krafft <madduck@debian.org>
Date
Nov 20, 2008, 12:08 UTC
Message-ID
<1227182928-24916-1-git-send-email-madduck@debian.org>

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)
Next: Petr Baudis
Message 1 of 2 in “Print help message when command is not proper”
  1. Print help message when command is not propermartin f. krafft, Nov 20, 2008
  2. Petr BaudisNov 20, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.