/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 bzrlib/commands.py

MergeĀ upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
18
# TODO: probably should say which arguments are candidates for glob
331
331
        return s
332
332
 
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.
336
336
 
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.
343
347
        """
344
348
        doc = self.help()
345
349
        if doc is None:
374
378
            result += options
375
379
        result += '\n'
376
380
 
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)
 
381
        if verbose:
 
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)
383
388
 
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.
386
 
        if sections:
387
 
            for label in order:
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.
 
391
            if sections:
 
392
                for label in order:
 
393
                    if sections.has_key(label):
 
394
                        result += ':%s:\n%s\n' % (label,sections[label])
 
395
                result += '\n'
 
396
        else:
 
397
            result += ("See bzr help %s for more details and examples.\n\n"
 
398
                % self.name())
390
399
 
391
400
        # Add the aliases, source (plug-in) and see also links, if any
392
401
        if self.aliases:
523
532
        if 'help' in opts:  # e.g. bzr add --help
524
533
            sys.stdout.write(self.get_help_text())
525
534
            return 0
 
535
        if 'usage' in opts:  # e.g. bzr add --usage
 
536
            sys.stdout.write(self.get_help_text(verbose=False))
 
537
            return 0
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()