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

[PATCH 1/3] Let "stg help" be like "stg --help"

From
Karl Hasselström <kha@treskal.com>
Date
Oct 22, 2006, 13:05 UTC
Message-ID
<20061022130520.16449.70729.stgit@localhost>
In-Reply-To
<20061022130214.16449.41482.stgit@localhost>
From: Karl Hasselström <kha@treskal.com>

"stg --help" prints the list of commands, but "stg help" just prints the usage message for the help command. This may be useful in theory, but the distinction is probably lost on 95% of all users (and the remaining 5% probably don't need to see the usage message for the help command anyway, since they know how it works). So just make both commands output the helpful command list.

Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 stgit/main.py |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/stgit/main.py b/stgit/main.py
index de35ca8..66128a3 100644
--- a/stgit/main.py
+++ b/stgit/main.py
@@ -226,8 +226,7 @@ def main():
                                   option_list = command.options)
             parser.print_help()
         else:
-            print 'usage: %s help <command>' % prog
-
+            print_help()
         sys.exit(0)
     if cmd in ['-v', '--version', 'version']:
         print 'Stacked GIT %s' % version
Previous: Karl HasselströmNext: Karl Hasselström
Message 2 of 4 in “Fix a few rough spots in StGIT's help command”
  1. 0/3 Fix a few rough spots in StGIT's help commandKarl Hasselström, Oct 22, 2006
  2. 1/3 Let "stg help" be like "stg --help"Karl Hasselström, Oct 22, 2006
  3. 2/3 When no command was given, print usage messageKarl Hasselström, Oct 22, 2006
  4. 3/3 Disregard extraneous arguments when providing helpKarl Hasselström, Oct 22, 2006

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.