/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

  • Committer: Robert Collins
  • Date: 2005-10-20 07:48:48 UTC
  • mfrom: (1475)
  • mto: This revision was merged to the branch mainline in revision 1477.
  • Revision ID: robertc@robertcollins.net-20051020074848-6dde0abbc59a1238
mergeĀ fromĀ upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
import os
32
32
from warnings import warn
33
33
from inspect import getdoc
 
34
import errno
34
35
 
35
36
import bzrlib
36
37
import bzrlib.trace
303
304
                    optname = a[2:]
304
305
                if optname not in cmd_options:
305
306
                    raise BzrCommandError('unknown long option %r for command %s' 
306
 
                            % (a, command.name))
 
307
                            % (a, command.name()))
307
308
            else:
308
309
                shortopt = a[1:]
309
310
                if shortopt in Option.SHORT_OPTIONS:
450
451
    --profile
451
452
        Run under the Python profiler.
452
453
    """
453
 
    # Load all of the transport methods
454
 
    import bzrlib.transport.local, bzrlib.transport.http
455
 
    
456
454
    argv = [a.decode(bzrlib.user_encoding) for a in argv]
457
455
 
458
456
    opt_profile = opt_no_plugins = opt_builtin = False
499
497
        ret = cmd_obj.run_argv(argv)
500
498
    return ret or 0
501
499
 
 
500
def display_command(func):
 
501
    def ignore_pipe(*args, **kwargs):
 
502
        try:
 
503
            func(*args, **kwargs)
 
504
        except IOError, e:
 
505
            if e.errno != errno.EPIPE:
 
506
                raise
 
507
    return ignore_pipe
502
508
 
503
509
def main(argv):
504
510
    import bzrlib.ui