~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
from __future__ import absolute_import
 
18
 
17
19
# TODO: Some way to get a list of external commands (defined by shell
18
20
# scripts) so that they can be included in the help listing as well.
19
21
# It should be enough to just list the plugin directory and look for
29
31
    help_topics,
30
32
    osutils,
31
33
    plugin,
 
34
    ui,
32
35
    utextwrap,
33
36
    )
34
37
 
36
39
def help(topic=None, outfile=None):
37
40
    """Write the help for the specific topic to outfile"""
38
41
    if outfile is None:
39
 
        outfile = sys.stdout
 
42
        outfile = ui.ui_factory.make_output_stream()
40
43
 
41
44
    indices = HelpIndices()
42
45
 
61
64
def help_commands(outfile=None):
62
65
    """List all commands"""
63
66
    if outfile is None:
64
 
        outfile = sys.stdout
 
67
        outfile = ui.ui_factory.make_output_stream()
65
68
    outfile.write(_help_commands_to_text('commands'))
66
69
 
67
70