~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

  • Committer: John Arbash Meinel
  • Date: 2006-06-18 02:21:57 UTC
  • mfrom: (1787 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1794.
  • Revision ID: john@arbash-meinel.com-20060618022157-6e33aa9b67c25e4f
[merge] bzr.dev 1787

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
    return s
86
86
 
87
87
 
88
 
def print_command_plugin(cmd_object, outfile, format):
89
 
    """Print the plugin that provides a command object, if any.
90
 
 
91
 
    If the cmd_object is provided by a plugin, prints the plugin name to
92
 
    outfile using the provided format string.
93
 
    """
94
 
    plugin_name = cmd_object.plugin_name()
95
 
    if plugin_name is not None:
96
 
        out_str = '(From plugin "%s")' % plugin_name
97
 
        outfile.write(format % out_str)
98
 
 
99
 
 
100
88
def help_on_command(cmdname, outfile=None):
101
89
    from bzrlib.commands import get_cmd_object
102
90
 
119
107
 
120
108
    print >>outfile
121
109
 
122
 
    print_command_plugin(cmd_object, outfile, '%s\n\n')
123
 
 
124
110
    outfile.write(doc)
125
111
    if doc[-1] != '\n':
126
112
        outfile.write('\n')
170
156
        if cmd_object.hidden:
171
157
            continue
172
158
        print >>outfile, command_usage(cmd_object)
173
 
 
174
 
        plugin_name = cmd_object.plugin_name()
175
 
        print_command_plugin(cmd_object, outfile, '        %s\n')
176
 
 
177
159
        cmd_help = cmd_object.help()
178
160
        if cmd_help:
179
161
            firstline = cmd_help.split('\n', 1)[0]