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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-06-23 01:17:33 UTC
  • mfrom: (7516.1.1 merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200623011733-ohfy5ukvyehd2kpf
Merge lp:brz/3.1.

Merged from https://code.launchpad.net/~jelmer/brz/merge-3.1/+merge/386223

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
from . import errors, registry
53
53
 
54
54
 
55
 
class BzrOptionError(errors.BzrCommandError):
 
55
class BzrOptionError(errors.CommandError):
56
56
 
57
57
    _fmt = "Error in command line options"
58
58
 
298
298
        # No command found, see if this was a typo
299
299
        candidate = guess_command(cmd_name)
300
300
        if candidate is not None:
301
 
            raise errors.BzrCommandError(
 
301
            raise errors.CommandError(
302
302
                gettext('unknown command "%s". Perhaps you meant "%s"')
303
303
                % (cmd_name, candidate))
304
 
        raise errors.BzrCommandError(gettext('unknown command "%s"')
 
304
        raise errors.CommandError(gettext('unknown command "%s"')
305
305
                                     % cmd_name)
306
306
 
307
307
 
910
910
    try:
911
911
        options, args = parser.parse_args(args)
912
912
    except UnicodeEncodeError:
913
 
        raise errors.BzrCommandError(
 
913
        raise errors.CommandError(
914
914
            gettext('Only ASCII permitted in option names'))
915
915
 
916
916
    opts = dict((k, v) for k, v in options.__dict__.items() if
935
935
                argdict[argname + '_list'] = None
936
936
        elif ap[-1] == '+':
937
937
            if not args:
938
 
                raise errors.BzrCommandError(gettext(
 
938
                raise errors.CommandError(gettext(
939
939
                    "command {0!r} needs one or more {1}").format(
940
940
                    cmd, argname.upper()))
941
941
            else:
943
943
                args = []
944
944
        elif ap[-1] == '$':  # all but one
945
945
            if len(args) < 2:
946
 
                raise errors.BzrCommandError(
 
946
                raise errors.CommandError(
947
947
                    gettext("command {0!r} needs one or more {1}").format(
948
948
                        cmd, argname.upper()))
949
949
            argdict[argname + '_list'] = args[:-1]
952
952
            # just a plain arg
953
953
            argname = ap
954
954
            if not args:
955
 
                raise errors.BzrCommandError(
 
955
                raise errors.CommandError(
956
956
                    gettext("command {0!r} requires argument {1}").format(
957
957
                        cmd, argname.upper()))
958
958
            else:
959
959
                argdict[argname] = args.pop(0)
960
960
 
961
961
    if args:
962
 
        raise errors.BzrCommandError(gettext(
 
962
        raise errors.CommandError(gettext(
963
963
            "extra argument to command {0}: {1}").format(
964
964
            cmd, args[0]))
965
965