/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 bzrlib/help.py

  • Committer: Martin Pool
  • Date: 2009-06-10 03:31:01 UTC
  • mfrom: (4070.12.3 249908-doc-generate)
  • mto: This revision was merged to the branch mainline in revision 4464.
  • Revision ID: mbp@sourcefrog.net-20090610033101-ce26xd79i9cbmpsd
Merge other outstanding work on 249908

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2004, 2005, 2006 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
30
30
    help_topics,
31
31
    osutils,
32
32
    plugin,
 
33
    symbol_versioning,
33
34
    )
34
35
 
35
36
 
72
73
        hidden = True
73
74
    else:
74
75
        hidden = False
75
 
    names = list(_mod_commands.all_command_names())
 
76
    names = set(_mod_commands.builtin_command_names()) # to eliminate duplicates
 
77
    names.update(_mod_commands.plugin_command_names())
76
78
    commands = ((n, _mod_commands.get_cmd_object(n)) for n in names)
77
79
    shown_commands = [(n, o) for n, o in commands if o.hidden == hidden]
78
80
    max_name = max(len(n) for n, o in shown_commands)
79
81
    indent = ' ' * (max_name + 1)
80
 
    width = osutils.terminal_width()
81
 
    if width is None:
82
 
        width = osutils.default_terminal_width
83
 
    # we need one extra space for terminals that wrap on last char
84
 
    width = width - 1
 
82
    width = osutils.terminal_width() - 1
85
83
 
86
84
    for cmd_name, cmd_object in sorted(shown_commands):
87
85
        plugin_name = cmd_object.plugin_name()