commands: adjust metavariables as appropriate
authorAnton Shestakov <av6@dwimlabs.net>
Wed, 17 Oct 2018 21:00:36 +0800
changeset 40346 943248e47864
parent 40345 d30a19d10441
child 40347 e5d74742d00e
commands: adjust metavariables as appropriate Apart from looking better in hg help command, these strings are also helpful when generating shell completions programmatically.
hgext/patchbomb.py
hgext/strip.py
mercurial/cmdutil.py
mercurial/commands.py
tests/test-bad-extension.t
tests/test-strip.t
--- a/hgext/patchbomb.py	Sun Oct 14 11:16:22 2018 -0400
+++ b/hgext/patchbomb.py	Wed Oct 17 21:00:36 2018 +0800
@@ -478,20 +478,25 @@
     ('', 'body', None, _('send patches as inline message text (default)')),
     ('a', 'attach', None, _('send patches as attachments')),
     ('i', 'inline', None, _('send patches as inline attachments')),
-    ('', 'bcc', [], _('email addresses of blind carbon copy recipients')),
-    ('c', 'cc', [], _('email addresses of copy recipients')),
+    ('', 'bcc', [],
+     _('email addresses of blind carbon copy recipients'), _('EMAIL')),
+    ('c', 'cc', [], _('email addresses of copy recipients'), _('EMAIL')),
     ('', 'confirm', None, _('ask for confirmation before sending')),
     ('d', 'diffstat', None, _('add diffstat output to messages')),
-    ('', 'date', '', _('use the given date as the sending date')),
-    ('', 'desc', '', _('use the given file as the series description')),
-    ('f', 'from', '', _('email address of sender')),
+    ('', 'date', '', _('use the given date as the sending date'), _('DATE')),
+    ('', 'desc', '',
+     _('use the given file as the series description'), _('FILE')),
+    ('f', 'from', '', _('email address of sender'), _('EMAIL')),
     ('n', 'test', None, _('print messages that would be sent')),
-    ('m', 'mbox', '', _('write messages to mbox file instead of sending them')),
-    ('', 'reply-to', [], _('email addresses replies should be sent to')),
-    ('s', 'subject', '', _('subject of first message (intro or single patch)')),
-    ('', 'in-reply-to', '', _('message identifier to reply to')),
-    ('', 'flag', [], _('flags to add in subject prefixes')),
-    ('t', 'to', [], _('email addresses of recipients'))]
+    ('m', 'mbox', '',
+     _('write messages to mbox file instead of sending them'), _('FILE')),
+    ('', 'reply-to', [],
+     _('email addresses replies should be sent to'), _('EMAIL')),
+    ('s', 'subject', '',
+     _('subject of first message (intro or single patch)'), _('TEXT')),
+    ('', 'in-reply-to', '', _('message identifier to reply to'), _('MSGID')),
+    ('', 'flag', [], _('flags to add in subject prefixes'), _('FLAG')),
+    ('t', 'to', [], _('email addresses of recipients'), _('EMAIL'))]
 
 @command('email',
     [('g', 'git', None, _('use git extended diff format')),
@@ -499,7 +504,8 @@
     ('o', 'outgoing', None,
      _('send changes not found in the target repository')),
     ('b', 'bundle', None, _('send changes not in target as a binary bundle')),
-    ('B', 'bookmark', '', _('send changes only reachable by given bookmark')),
+    ('B', 'bookmark', '',
+     _('send changes only reachable by given bookmark'), _('BOOKMARK')),
     ('', 'bundlename', 'bundle',
      _('name of the bundle attachment file'), _('NAME')),
     ('r', 'rev', [], _('a revision to send'), _('REV')),
--- a/hgext/strip.py	Sun Oct 14 11:16:22 2018 -0400
+++ b/hgext/strip.py	Wed Oct 17 21:00:36 2018 +0800
@@ -110,7 +110,7 @@
           ('k', 'keep', None, _("do not modify working directory during "
                                 "strip")),
           ('B', 'bookmark', [], _("remove revs only reachable from given"
-                                  " bookmark"))],
+                                  " bookmark"), _('BOOKMARK'))],
           _('hg strip [-k] [-f] [-B bookmark] [-r] REV...'),
           helpcategory=command.CATEGORY_MAINTENANCE)
 def stripcmd(ui, repo, *revs, **opts):
--- a/mercurial/cmdutil.py	Sun Oct 14 11:16:22 2018 -0400
+++ b/mercurial/cmdutil.py	Wed Oct 17 21:00:36 2018 +0800
@@ -149,7 +149,7 @@
 ]
 
 mergetoolopts = [
-    ('t', 'tool', '', _('specify merge tool')),
+    ('t', 'tool', '', _('specify merge tool'), _('TOOL')),
 ]
 
 similarityopts = [
--- a/mercurial/commands.py	Sun Oct 14 11:16:22 2018 -0400
+++ b/mercurial/commands.py	Wed Oct 17 21:00:36 2018 +0800
@@ -1996,7 +1996,7 @@
 
 @command('export',
     [('B', 'bookmark', '',
-     _('export changes only reachable by given bookmark')),
+     _('export changes only reachable by given bookmark'), _('BOOKMARK')),
     ('o', 'output', '',
      _('print output to file with formatted name'), _('FORMAT')),
     ('', 'switch-parent', None, _('diff against the second parent')),
@@ -2257,7 +2257,7 @@
      ('D', 'currentdate', False,
       _('record the current date as commit date')),
      ('U', 'currentuser', False,
-      _('record the current user as committer'), _('DATE'))]
+      _('record the current user as committer'))]
     + commitopts2 + mergetoolopts  + dryrunopts,
     _('[OPTION]... [-r REV]... REV...'),
     helpcategory=command.CATEGORY_CHANGE_MANAGEMENT)
@@ -3016,9 +3016,10 @@
     [('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)')),
+     ('s', 'system', [],
+      _('show help for specific platform(s)'), _('PLATFORM')),
      ],
-    _('[-ecks] [TOPIC]'),
+    _('[-eck] [-s PLATFORM] [TOPIC]'),
     helpcategory=command.CATEGORY_HELP,
     norepo=True,
     intents={INTENT_READONLY})
--- a/tests/test-bad-extension.t	Sun Oct 14 11:16:22 2018 -0400
+++ b/tests/test-bad-extension.t	Wed Oct 17 21:00:36 2018 +0800
@@ -10,7 +10,7 @@
   > EOF
   $ hg -q --config extensions.bailatexit=$TESTTMP/bailatexit.py \
   >  help help
-  hg help [-ecks] [TOPIC]
+  hg help [-eck] [-s PLATFORM] [TOPIC]
   
   show help for a given topic or a help overview
   error in exit handlers:
--- a/tests/test-strip.t	Sun Oct 14 11:16:22 2018 -0400
+++ b/tests/test-strip.t	Wed Oct 17 21:00:36 2018 +0800
@@ -715,14 +715,14 @@
   
   options ([+] can be repeated):
   
-   -r --rev REV [+]        strip specified revision (optional, can specify
-                           revisions without this option)
-   -f --force              force removal of changesets, discard uncommitted
-                           changes (no backup)
-      --no-backup          do not save backup bundle
-   -k --keep               do not modify working directory during strip
-   -B --bookmark VALUE [+] remove revs only reachable from given bookmark
-      --mq                 operate on patch repository
+   -r --rev REV [+]           strip specified revision (optional, can specify
+                              revisions without this option)
+   -f --force                 force removal of changesets, discard uncommitted
+                              changes (no backup)
+      --no-backup             do not save backup bundle
+   -k --keep                  do not modify working directory during strip
+   -B --bookmark BOOKMARK [+] remove revs only reachable from given bookmark
+      --mq                    operate on patch repository
   
   (use 'hg strip -h' to show more help)
   [255]