diff options
author | Jesse Keating <jkeating@redhat.com> | 2011-02-04 17:49:42 -0700 |
---|---|---|
committer | Jesse Keating <jkeating@redhat.com> | 2011-02-04 17:49:42 -0700 |
commit | 32e4a38579250756718659134766b20d6c72fb5a (patch) | |
tree | ea1f455aad4db88dac3837e427042d24502e0ae2 /src/pyfedpkg | |
parent | c554d2c5284eb3dd6dc37b5b709a7d59d37c86c8 (diff) | |
download | fedora-packager-32e4a38579250756718659134766b20d6c72fb5a.tar.gz fedora-packager-32e4a38579250756718659134766b20d6c72fb5a.tar.xz fedora-packager-32e4a38579250756718659134766b20d6c72fb5a.zip |
Kill the Commands section.
Want to use the COMMAND OVERVIEW option instead.
Diffstat (limited to 'src/pyfedpkg')
-rw-r--r-- | src/pyfedpkg/man_page.py | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/src/pyfedpkg/man_page.py b/src/pyfedpkg/man_page.py index 47285f2..117ad62 100644 --- a/src/pyfedpkg/man_page.py +++ b/src/pyfedpkg/man_page.py @@ -111,36 +111,20 @@ def generate(parser, subparsers): for pa in subparsers._choices_actions: help_texts[pa.dest] = getattr(pa, 'help', None) - if True: # Either kill THIS - # determine length of longest command and generate format string - commands = help_texts.keys() - commands.sort(lambda a,b: cmp(len(b), len(a))) - max_cmdlen = len(commands[0]) - fmtstring = ' %%-%ds %%s\n' % (max_cmdlen,) - - man_file.write('.SS "Commands"\n') - - for command in k: - cmdparser = choices[command] - if not cmdparser.add_help: - continue - man_file.write(fmtstring % (command, help_texts[command])) - - if True: # Or kill THIS - man_file.write('.SH "COMMAND OVERVIEW"\n') - - for command in k: - cmdparser = choices[command] - if not cmdparser.add_help: - continue - usage = cmdparser.format_usage() - usage = strip_usage(usage) - usage = ''.join(usage.split('\n')) - usage = ' '.join(usage.split()) - if help_texts[command]: - man_file.write('.TP\n.B "%s"\n%s\n' % (usage, help_texts[command])) - else: - man_file.write('.TP\n.B "%s"\n' % (usage)) + man_file.write('.SH "COMMAND OVERVIEW"\n') + + for command in k: + cmdparser = choices[command] + if not cmdparser.add_help: + continue + usage = cmdparser.format_usage() + usage = strip_usage(usage) + usage = ''.join(usage.split('\n')) + usage = ' '.join(usage.split()) + if help_texts[command]: + man_file.write('.TP\n.B "%s"\n%s\n' % (usage, help_texts[command])) + else: + man_file.write('.TP\n.B "%s"\n' % (usage)) man_file.write('.SH "COMMAND REFERENCE"\n') for command in k: |