/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/help.py

  • Committer: Jelmer Vernooij
  • Date: 2018-02-18 21:42:57 UTC
  • mto: This revision was merged to the branch mainline in revision 6859.
  • Revision ID: jelmer@jelmer.uk-20180218214257-jpevutp1wa30tz3v
Update TODO to reference Breezy, not Bazaar.

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
21
23
 
22
24
# TODO: `help commands --all` should show hidden commands
23
25
 
 
26
import sys
 
27
 
24
28
from . import (
25
29
    commands as _mod_commands,
26
30
    errors,
35
39
class NoHelpTopic(errors.BzrError):
36
40
 
37
41
    _fmt = ("No help could be found for '%(topic)s'. "
38
 
            "Please use 'brz help topics' to obtain a list of topics.")
 
42
        "Please use 'brz help topics' to obtain a list of topics.")
39
43
 
40
44
    def __init__(self, topic):
41
45
        self.topic = topic
54
58
        shadowed_terms = []
55
59
        for index, topic_obj in topics[1:]:
56
60
            shadowed_terms.append('%s%s' % (index.prefix,
57
 
                                            topic_obj.get_help_topic()))
 
61
                topic_obj.get_help_topic()))
58
62
        source = topics[0][1]
59
63
        outfile.write(source.get_help_text(shadowed_terms))
60
64
    except NoHelpTopic:
63
67
 
64
68
    if alias is not None:
65
69
        outfile.write("'brz %s' is an alias for 'brz %s'.\n" % (topic,
66
 
                                                                " ".join(alias)))
 
70
            " ".join(alias)))
67
71
 
68
72
 
69
73
def help_commands(outfile=None):
165
169
        self._check_prefix_uniqueness()
166
170
        result = []
167
171
        for index in self.search_path:
168
 
            result.extend([(index, _topic)
169
 
                           for _topic in index.get_topics(topic)])
 
172
            result.extend([(index, _topic) for _topic in index.get_topics(topic)])
170
173
        if not result:
171
174
            raise NoHelpTopic(topic)
172
175
        else: