327 break |
327 break |
328 else: |
328 else: |
329 cmd = aliases[0] |
329 cmd = aliases[0] |
330 return (cmd, name, mod) |
330 return (cmd, name, mod) |
331 |
331 |
|
332 ext = None |
332 # first, search for an extension with the same name as the command |
333 # first, search for an extension with the same name as the command |
333 path = paths.pop(cmd, None) |
334 path = paths.pop(cmd, None) |
334 if path: |
335 if path: |
335 ext = findcmd(cmd, cmd, path) |
336 ext = findcmd(cmd, cmd, path) |
336 if ext: |
337 if not ext: |
337 return ext |
338 # otherwise, interrogate each extension until there's a match |
338 |
339 for name, path in paths.iteritems(): |
339 # otherwise, interrogate each extension until there's a match |
340 ext = findcmd(cmd, name, path) |
340 for name, path in paths.iteritems(): |
341 if ext: |
341 ext = findcmd(cmd, name, path) |
342 break |
342 if ext: |
343 if ext and 'DEPRECATED' not in ext.__doc__: |
343 return ext |
344 return ext |
344 |
345 |
345 raise error.UnknownCommand(cmd) |
346 raise error.UnknownCommand(cmd) |
346 |
347 |
347 def enabled(): |
348 def enabled(): |
348 '''return a dict of {name: desc} of extensions''' |
349 '''return a dict of {name: desc} of extensions''' |