comparison mercurial/commands.py @ 22585:15282c6612fb

help: support OS-specific help sections Containers of the form: .. container:: verbose.<os> are shown by default on the given OS (or with -v).
author Matt Mackall <mpm@selenic.com>
date Tue, 30 Sep 2014 15:51:22 -0500
parents 939ce500c92a
children c3c3dd31fe1c
comparison
equal deleted inserted replaced
22584:19bd8bda6bb2 22585:15282c6612fb
3819 Returns 0 if successful. 3819 Returns 0 if successful.
3820 """ 3820 """
3821 3821
3822 textwidth = min(ui.termwidth(), 80) - 2 3822 textwidth = min(ui.termwidth(), 80) - 2
3823 3823
3824 keep = ui.verbose and ['verbose'] or [] 3824 keep = []
3825 if ui.verbose:
3826 keep.append('verbose')
3827 if sys.platform.startswith('win'):
3828 keep.append('windows')
3829 elif sys.platform == 'OpenVMS':
3830 keep.append('vms')
3831 elif sys.platform == 'plan9':
3832 keep.append('plan9')
3833 else:
3834 keep.append('unix')
3835 keep.append(sys.platform.lower())
3836
3825 text = help.help_(ui, name, **opts) 3837 text = help.help_(ui, name, **opts)
3826 3838
3827 formatted, pruned = minirst.format(text, textwidth, keep=keep) 3839 formatted, pruned = minirst.format(text, textwidth, keep=keep)
3828 if 'verbose' in pruned: 3840 if 'verbose' in pruned:
3829 keep.append('omitted') 3841 keep.append('omitted')