Mercurial > hg-stable
changeset 1049:160a68cd393f
Allow --help and --version being used together.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 26 Aug 2005 08:42:56 +0200 |
parents | 7fbb440b2e63 |
children | 9c09094de48c |
files | mercurial/commands.py |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Fri Aug 26 08:37:41 2005 +0200 +++ b/mercurial/commands.py Fri Aug 26 08:42:56 2005 +0200 @@ -269,9 +269,12 @@ "not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" ) -def help_(ui, cmd=None): +def help_(ui, cmd=None, with_version=False): """show help for a given command or all commands""" if cmd and cmd != 'shortlist': + if with_version: + show_version(ui) + ui.write('\n') key, i = find(cmd) # synopsis ui.write("%s\n\n" % i[2]) @@ -305,7 +308,7 @@ else: # program name - if ui.verbose: + if ui.verbose or with_version: show_version(ui) else: ui.status("Mercurial Distributed SCM\n") @@ -1634,7 +1637,7 @@ try: try: if options['help']: - help_(u, cmd) + help_(u, cmd, options['version']) sys.exit(0) elif options['version']: show_version(u)