equal
deleted
inserted
replaced
21 for each matching command. |
21 for each matching command. |
22 Return debug commands (or their aliases) only if no normal command matches. |
22 Return debug commands (or their aliases) only if no normal command matches. |
23 """ |
23 """ |
24 choice = {} |
24 choice = {} |
25 debugchoice = {} |
25 debugchoice = {} |
26 for e in table.keys(): |
26 |
|
27 if cmd in table: |
|
28 # short-circuit exact matches, "log" alias beats "^log|history" |
|
29 keys = [cmd] |
|
30 else: |
|
31 keys = table.keys() |
|
32 |
|
33 for e in keys: |
27 aliases = parsealiases(e) |
34 aliases = parsealiases(e) |
28 found = None |
35 found = None |
29 if cmd in aliases: |
36 if cmd in aliases: |
30 found = cmd |
37 found = cmd |
31 elif not strict: |
38 elif not strict: |