From: Pavel Roskin <proski@gnu.org>
To: git <git@vger.kernel.org>, Catalin Marinas <catalin.marinas@gmail.com>
Subject: [PATCH] Treat "stg --help cmd" and "stg help cmd" like "stg cmd --help"
Date: Fri, 27 Jan 2006 00:17:28 -0500 [thread overview]
Message-ID: <1138339048.1801.3.camel@dv> (raw)
User's intention is perfectly clear if "-h", "--help" or "help" is
followed by a valid command - show help for that command.
Signed-off-by: Pavel Roskin <proski@gnu.org>
---
stgit/main.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/stgit/main.py b/stgit/main.py
index 2336a43..6d86ee4 100644
--- a/stgit/main.py
+++ b/stgit/main.py
@@ -125,8 +125,12 @@ def main():
cmd = sys.argv[1]
if cmd in ['-h', '--help', 'help']:
- print_help()
- sys.exit(0)
+ if len(sys.argv) == 3 and sys.argv[2] in commands:
+ cmd = sys.argv[2]
+ sys.argv[2] = '--help';
+ else:
+ print_help()
+ sys.exit(0)
if cmd in ['-v', '--version', 'version']:
print 'Stacked GIT %s' % version
os.system('git --version')
--
Regards,
Pavel Roskin
reply other threads:[~2006-01-27 5:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1138339048.1801.3.camel@dv \
--to=proski@gnu.org \
--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).