~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Robert Collins
  • Date: 2005-10-20 04:08:12 UTC
  • mfrom: (1185.12.68)
  • Revision ID: robertc@robertcollins.net-20051020040812-fecd1bc32aa3478e
Merge from Aaron Bentley.

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:
496
497
        ret = cmd_obj.run_argv(argv)
497
498
    return ret or 0
498
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
499
508
 
500
509
def main(argv):
501
510
    import bzrlib.ui