~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

  • Committer: Michael Ellerman
  • Date: 2006-02-28 14:45:51 UTC
  • mto: (1558.1.18 Aaron's integration)
  • mto: This revision was merged to the branch mainline in revision 1586.
  • Revision ID: michael@ellerman.id.au-20060228144551-3d9941ecde4a0b0a
Update contrib/pwk for -p1 diffs from bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005, 2006 by Canonical Ltd
 
1
# Copyright (C) 2004, 2005 by 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
24
24
 
25
25
global_help = \
26
26
"""Bazaar-NG -- a free distributed version-control tool
27
 
http://bazaar-vcs.org/
 
27
http://bazaar-ng.org/
 
28
 
 
29
WARNING: This is an unstable development version.
 
30
         Please keep backups.
28
31
 
29
32
Basic commands:
30
33
 
85
88
    return s
86
89
 
87
90
 
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
91
def help_on_command(cmdname, outfile=None):
101
92
    from bzrlib.commands import get_cmd_object
102
93
 
119
110
 
120
111
    print >>outfile
121
112
 
122
 
    print_command_plugin(cmd_object, outfile, '%s\n\n')
123
 
 
124
113
    outfile.write(doc)
125
114
    if doc[-1] != '\n':
126
115
        outfile.write('\n')
170
159
        if cmd_object.hidden:
171
160
            continue
172
161
        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
162
        cmd_help = cmd_object.help()
178
163
        if cmd_help:
179
164
            firstline = cmd_help.split('\n', 1)[0]