mercurial/commands.py
changeset 27763 0ac5b7ee5dc2
parent 27751 a40e2f7fe49d
child 27771 338c9d227a9e
--- a/mercurial/commands.py	Sun Jan 10 06:21:40 2016 +0000
+++ b/mercurial/commands.py	Sun Jan 10 08:03:58 2016 +0000
@@ -4367,8 +4367,9 @@
     [('e', 'extension', None, _('show only help for extensions')),
      ('c', 'command', None, _('show only help for commands')),
      ('k', 'keyword', None, _('show topics matching keyword')),
+     ('s', 'system', [], _('show help for specific platform(s)')),
      ],
-    _('[-eck] [TOPIC]'),
+    _('[-ecks] [TOPIC]'),
     norepo=True)
 def help_(ui, name=None, **opts):
     """show help for a given topic or a help overview
@@ -4383,18 +4384,19 @@
 
     textwidth = min(ui.termwidth(), 80) - 2
 
-    keep = []
+    keep = opts.get('system') or []
+    if len(keep) == 0:
+        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())
     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())
 
     section = None
     subtopic = None