##// END OF EJS Templates
alias: provide "unknowncmd" flag to tell help to look for disabled command...
Yuya Nishihara -
r22161:06362842 default
parent child Browse files
Show More
@@ -364,6 +364,7 class cmdalias(object):
364 364 self.norepo = True
365 365 self.optionalrepo = False
366 366 self.badalias = None
367 self.unknowncmd = False
367 368
368 369 try:
369 370 aliases, entry = cmdutil.findcmd(self.name, cmdtable)
@@ -433,16 +434,9 class cmdalias(object):
433 434 self.__doc__ = self.fn.__doc__
434 435
435 436 except error.UnknownCommand:
436 def fn(ui, *args):
437 try:
438 # check if the command is in a disabled extension
439 commands.help_(ui, cmd, unknowncmd=True)
440 except error.UnknownCommand:
441 pass
442 return -1
443 self.fn = fn
444 437 self.badalias = (_("alias '%s' resolves to unknown command '%s'")
445 438 % (self.name, cmd))
439 self.unknowncmd = True
446 440 except error.AmbiguousCommand:
447 441 self.badalias = (_("alias '%s' resolves to ambiguous command '%s'")
448 442 % (self.name, cmd))
@@ -450,8 +444,12 class cmdalias(object):
450 444 def __call__(self, ui, *args, **opts):
451 445 if self.badalias:
452 446 ui.warn(self.badalias + '\n')
453 if self.fn:
454 return self.fn(ui, *args, **opts)
447 if self.unknowncmd:
448 try:
449 # check if the command is in a disabled extension
450 commands.help_(ui, self.cmdname, unknowncmd=True)
451 except error.UnknownCommand:
452 pass
455 453 return -1
456 454 if self.shadows:
457 455 ui.debug("alias '%s' shadows command '%s'\n" %
General Comments 0
You need to be logged in to leave comments. Login now