[PATCH 3/3] Disregard extraneous arguments when providing help
- From
Karl Hasselström <kha@treskal.com>
- Date
- Oct 22, 2006, 13:05 UTC
- Message-ID
- <20061022130531.16449.50598.stgit@localhost>
- 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: