# HG changeset patch # User Matt Mackall # Date 2014-09-30 20:51:22 # Node ID 15282c6612fb013140bfe5bc59cb0b5990def558 # Parent 19bd8bda6bb2c27f9635e22b2f3b6e3a3275384a help: support OS-specific help sections Containers of the form: .. container:: verbose. are shown by default on the given OS (or with -v). diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -3821,7 +3821,19 @@ def help_(ui, name=None, **opts): textwidth = min(ui.termwidth(), 80) - 2 - keep = ui.verbose and ['verbose'] or [] + keep = [] + if ui.verbose: + keep.append('verbose') + if sys.platform.startswith('win'): + keep.append('windows') + elif sys.platform == 'OpenVMS': + keep.append('vms') + elif sys.platform == 'plan9': + keep.append('plan9') + else: + keep.append('unix') + keep.append(sys.platform.lower()) + text = help.help_(ui, name, **opts) formatted, pruned = minirst.format(text, textwidth, keep=keep)