git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Karl Hasselström" <kha@treskal.com>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org
Subject: [PATCH 3/3] Disregard extraneous arguments when providing help
Date: Sun, 22 Oct 2006 15:05:31 +0200	[thread overview]
Message-ID: <20061022130531.16449.50598.stgit@localhost> (raw)
In-Reply-To: <20061022130214.16449.41482.stgit@localhost>

From: Karl Hasselström <kha@treskal.com>

"stg --help pop" prints the help text for pop, but "stg --help pop
foo" just prints the list of commands. That's silly, so fix it by
simply ignoring the extra arguments.

Signed-off-by: Karl Hasselström <kha@treskal.com>
---

 stgit/main.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/stgit/main.py b/stgit/main.py
index 02d1eb1..9fa0afc 100644
--- a/stgit/main.py
+++ b/stgit/main.py
@@ -206,7 +206,7 @@ def main():
     cmd = sys.argv[1]
 
     if cmd in ['-h', '--help']:
-        if len(sys.argv) == 3 and sys.argv[2] in commands:
+        if len(sys.argv) >= 3 and sys.argv[2] in commands:
             cmd = sys.argv[2]
             sys.argv[2] = '--help'
         else:

      parent reply	other threads:[~2006-10-22 13:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-22 13:02 [PATCH 0/3] Fix a few rough spots in StGIT's help command Karl Hasselström
2006-10-22 13:05 ` [PATCH 1/3] Let "stg help" be like "stg --help" Karl Hasselström
2006-10-22 13:05 ` [PATCH 2/3] When no command was given, print usage message Karl Hasselström
2006-10-22 13:05 ` Karl Hasselström [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061022130531.16449.50598.stgit@localhost \
    --to=kha@treskal.com \
    --cc=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).