From a9d82c361e1923fc487ec06d4fa091ef1511732a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karl=20Hasselstr=C3=B6m?= Date: Wed, 25 Oct 2006 20:24:54 +0100 Subject: [PATCH] Disregard extraneous arguments when providing help MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit "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 --- stgit/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stgit/main.py b/stgit/main.py index ea65288..183f9d7 100644 --- a/stgit/main.py +++ b/stgit/main.py @@ -203,7 +203,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: -- 2.11.0