comparison doc/gendoc.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 2d88369a27bf
comparison
equal deleted inserted replaced
11320:e4274f9f97c8 11321:40c06bbf58be
23 else: 23 else:
24 desc = " %s" % shortdesc 24 desc = " %s" % shortdesc
25 return (shortdesc, desc) 25 return (shortdesc, desc)
26 26
27 def get_opts(opts): 27 def get_opts(opts):
28 for shortopt, longopt, default, desc in opts: 28 for opt in opts:
29 if len(opt) == 5:
30 shortopt, longopt, default, desc, optlabel = opt
31 else:
32 shortopt, longopt, default, desc = opt
29 allopts = [] 33 allopts = []
30 if shortopt: 34 if shortopt:
31 allopts.append("-%s" % shortopt) 35 allopts.append("-%s" % shortopt)
32 if longopt: 36 if longopt:
33 allopts.append("--%s" % longopt) 37 allopts.append("--%s" % longopt)