~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

  • Committer: INADA Naoki
  • Date: 2010-03-03 12:14:16 UTC
  • mfrom: (4634.171.4 fix-523746-2)
  • mto: This revision was merged to the branch mainline in revision 5892.
  • Revision ID: inada-n@klab.jp-20100303121416-uemvz4l5y1ilclv6
merge #523746 fix from lp:~songofacandy/bzr/fix-523746-2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005-2010 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
78
78
    shown_commands = [(n, o) for n, o in commands if o.hidden == hidden]
79
79
    max_name = max(len(n) for n, o in shown_commands)
80
80
    indent = ' ' * (max_name + 1)
81
 
    width = osutils.terminal_width() - 1
 
81
    width = osutils.terminal_width()
 
82
    if width is None:
 
83
        width = osutils.default_terminal_width
 
84
    # we need one extra space for terminals that wrap on last char
 
85
    width = width - 1
82
86
 
83
87
    for cmd_name, cmd_object in sorted(shown_commands):
84
88
        plugin_name = cmd_object.plugin_name()