~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

  • Committer: Martin Packman
  • Date: 2012-02-27 12:16:28 UTC
  • mto: (6437.23.25 2.5)
  • mto: This revision was merged to the branch mainline in revision 6499.
  • Revision ID: martin.packman@canonical.com-20120227121628-9q8krey0u73v56k3
Get default stream for help output via ui_factory instead of using stdout directly

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    help_topics,
32
32
    osutils,
33
33
    plugin,
 
34
    ui,
34
35
    utextwrap,
35
36
    )
36
37
 
38
39
def help(topic=None, outfile=None):
39
40
    """Write the help for the specific topic to outfile"""
40
41
    if outfile is None:
41
 
        outfile = sys.stdout
 
42
        outfile = ui.ui_factory.make_output_stream()
42
43
 
43
44
    indices = HelpIndices()
44
45
 
63
64
def help_commands(outfile=None):
64
65
    """List all commands"""
65
66
    if outfile is None:
66
 
        outfile = sys.stdout
 
67
        outfile = ui.ui_factory.make_output_stream()
67
68
    outfile.write(_help_commands_to_text('commands'))
68
69
 
69
70