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

[PATCH] On error, do not list all commands, but point to --help option

From
Jari Aalto <jari.aalto@cante.net>
Date
Oct 20, 2007, 22:41 UTC
Message-ID
<ir51if2y.fsf@blue.sea.net>
In-Reply-To
<bqaujirk.fsf@blue.sea.net>
- Remove out call to list_common_cmds_help()
- Send error message to stderr, not stdout.
Signed-off-by: Jari Aalto <jari.aalto@cante.net>
---
 help.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/help.c b/help.c
index 1cd33ec..814a8cd 100644
--- a/help.c
+++ b/help.c
@@ -185,8 +185,7 @@ static void show_man_page(const char *git_cmd)
 
 void help_unknown_cmd(const char *cmd)
 {
-	printf("git: '%s' is not a git-command\n\n", cmd);
-	list_common_cmds_help();
+	fprintf(stderr, "git: '%s' is not a git-command. See --help\n\n", cmd);
 	exit(1);
 }
 
-- 
1.5.3.2.81.g17ed
Previous: Salikh ZakirovNext: Shawn O. Pearce
Message 14 of 16 in “On error, do not list all commands, but point to --help option.”
  1. On error, do not list all commands, but point to --help option.Jari Aalto, Oct 20, 2007
  2. Johannes SchindelinOct 20, 2007
  3. Jari AaltoOct 20, 2007
  4. Johannes SchindelinOct 20, 2007
  5. Shawn O. PearceOct 21, 2007
  6. Jeff KingOct 21, 2007
  7. Shawn O. PearceOct 21, 2007
  8. Yin PingOct 21, 2007
  9. Wincent ColaiutaOct 21, 2007
  10. Andreas EricssonOct 21, 2007
  11. Jan HudecOct 21, 2007
  12. Andreas EricssonOct 21, 2007
  13. Salikh ZakirovOct 24, 2007
  14. On error, do not list all commands, but point to --help optionJari Aalto, Oct 20, 2007
  15. Shawn O. PearceOct 21, 2007
  16. Jan HudecOct 21, 2007

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.