333
333
def get_help_text(self, additional_see_also=None, plain=True,
334
see_also_as_links=False):
334
see_also_as_links=False, verbose=True):
335
335
"""Return a text string with help for this command.
337
337
:param additional_see_also: Additional help topics to be
340
340
returned instead of plain text.
341
341
:param see_also_as_links: if True, convert items in 'See also'
342
342
list to internal links (used by bzr_man rstx generator)
343
:param verbose: if True, display the full help, otherwise
344
leave out the descriptive sections and just display
345
usage help (e.g. Purpose, Usage, Options) with a
346
message explaining how to obtain full help.
344
348
doc = self.help()
374
378
result += options
377
# Add the description, indenting it 2 spaces
378
# to match the indentation of the options
379
if sections.has_key(None):
380
text = sections.pop(None)
381
text = '\n '.join(text.splitlines())
382
result += ':%s:\n %s\n\n' % ('Description',text)
382
# Add the description, indenting it 2 spaces
383
# to match the indentation of the options
384
if sections.has_key(None):
385
text = sections.pop(None)
386
text = '\n '.join(text.splitlines())
387
result += ':%s:\n %s\n\n' % ('Description',text)
384
# Add the custom sections (e.g. Examples). Note that there's no need
385
# to indent these as they must be indented already in the source.
388
if sections.has_key(label):
389
result += ':%s:\n%s\n\n' % (label,sections[label])
389
# Add the custom sections (e.g. Examples). Note that there's no need
390
# to indent these as they must be indented already in the source.
393
if sections.has_key(label):
394
result += ':%s:\n%s\n' % (label,sections[label])
397
result += ("See bzr help %s for more details and examples.\n\n"
391
400
# Add the aliases, source (plug-in) and see also links, if any
523
532
if 'help' in opts: # e.g. bzr add --help
524
533
sys.stdout.write(self.get_help_text())
535
if 'usage' in opts: # e.g. bzr add --usage
536
sys.stdout.write(self.get_help_text(verbose=False))
526
538
trace.set_verbosity_level(option._verbosity_level)
527
539
if 'verbose' in self.supported_std_options:
528
540
opts['verbose'] = trace.is_verbose()