~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

  • Committer: John Arbash Meinel
  • Date: 2005-11-14 17:02:35 UTC
  • mto: (1587.1.6 bound-branches)
  • mto: This revision was merged to the branch mainline in revision 1590.
  • Revision ID: john@arbash-meinel.com-20051114170235-f85afa458bae956e
Fixing up the error message for a failed bind.

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')
127
 
    help_on_command_options(cmd_object, outfile)
 
116
    help_on_command_options(cmd_object, outfile=None)
128
117
 
129
118
 
130
119
def help_on_command_options(cmd, outfile=None):
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]
180
 
            print >>outfile, '        ' + firstline
 
165
            print >>outfile, '    ' + firstline
181
166