/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tools/doc_generate/autodoc_rstx.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-03-06 00:37:58 UTC
  • mfrom: (2309.3.2 manpage.test)
  • Revision ID: pqm@pqm.ubuntu.com-20070306003758-f693dc70e8b3706b
(bialix,r=john) little fix for manpage generator (handling absent
 help for commands options)

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
    if options:
113
113
        option_str = "\n    Options:\n"
114
114
        for option_name, option in sorted(options.items()):
115
 
            l = '        --' + option_name
116
 
            if option.type is not None:
117
 
                l += ' ' + option.argname.upper()
118
 
            short_name = option.short_name()
119
 
            if short_name:
120
 
                assert len(short_name) == 1
121
 
                l += ', -' + short_name
122
 
            l += (30 - len(l)) * ' ' + option.help
123
 
            # TODO: Split help over multiple lines with
124
 
            # correct indenting and wrapping.
125
 
            wrapped = textwrap.fill(l, initial_indent='',
126
 
                                    subsequent_indent=30*' ')
127
 
            option_str = option_str + wrapped + '\n'
 
115
            for name, short_name, argname, help in option.iter_switches():
 
116
                l = '    --' + name
 
117
                if argname is not None:
 
118
                    l += ' ' + argname
 
119
                if short_name:
 
120
                    assert len(short_name) == 1
 
121
                    l += ', -' + short_name
 
122
                l += (30 - len(l)) * ' ' + (help or '')
 
123
                # TODO: Split help over multiple lines with
 
124
                # correct indenting and wrapping.
 
125
                wrapped = textwrap.fill(l, initial_indent='',
 
126
                                        subsequent_indent=30*' ')
 
127
                option_str = option_str + wrapped + '\n'       
128
128
 
129
129
    aliases_str = ""
130
130
    if cmd.aliases: