# HG changeset patch # User Thomas Arendsen Hein # Date 1125038576 -7200 # Node ID 160a68cd393f3ade8ba28f11a5bcf5a30a8fc391 # Parent 7fbb440b2e6315bdfe54be2b0b6958645ad34034 Allow --help and --version being used together. diff -r 7fbb440b2e63 -r 160a68cd393f mercurial/commands.py --- 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)