diff mercurial/fancyopts.py @ 11321:40c06bbf58be

help: show value requirement and multiple occurrence of options this helps users to know what kind of option is: - no value is required(flag option) - value is required - value is required, and multiple occurrences are allowed each kinds are shown as below: -f --force force push -e --ssh CMD specify ssh command to use -b --branch BRANCH [+] a specific branch you would like to push if one or more 3rd type options are shown, explanation for '[+]' mark is also shown as footnote.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sun, 06 Jun 2010 17:25:00 +0900
parents 08a0f04b56bd
children d3bb825ddae3
line wrap: on
line diff
--- a/mercurial/fancyopts.py	Wed Jun 09 12:45:48 2010 +0100
+++ b/mercurial/fancyopts.py	Sun Jun 06 17:25:00 2010 +0900
@@ -43,6 +43,7 @@
       long option
       default value
       description
+      option value label(optional)
 
     option types include:
 
@@ -59,7 +60,11 @@
     argmap = {}
     defmap = {}
 
-    for short, name, default, comment in options:
+    for option in options:
+        if len(option) == 5:
+            short, name, default, comment, dummy = option
+        else:
+            short, name, default, comment = option
         # convert opts to getopt format
         oname = name
         name = name.replace('-', '_')