##// END OF EJS Templates
Hide debug commands in ambiguous command list, unless no normal command matches....
Thomas Arendsen Hein -
r1850:05f6c0d1 default
parent child Browse files
Show More
@@ -2679,15 +2679,22 b' norepo = ("clone init version help debug'
2679 def find(cmd):
2679 def find(cmd):
2680 """Return (aliases, command table entry) for command string."""
2680 """Return (aliases, command table entry) for command string."""
2681 choice = []
2681 choice = []
2682 debugchoice = []
2682 for e in table.keys():
2683 for e in table.keys():
2683 aliases = e.lstrip("^").split("|")
2684 aliases = e.lstrip("^").split("|")
2684 if cmd in aliases:
2685 if cmd in aliases:
2685 return aliases, table[e]
2686 return aliases, table[e]
2686 for a in aliases:
2687 for a in aliases:
2687 if a.startswith(cmd):
2688 if a.startswith(cmd):
2688 choice.append([aliases, table[e]])
2689 if aliases[0].startswith("debug"):
2690 debugchoice.append([aliases, table[e]])
2691 else:
2692 choice.append([aliases, table[e]])
2689 break
2693 break
2690
2694
2695 if not choice and debugchoice:
2696 choice = debugchoice
2697
2691 if len(choice) > 1:
2698 if len(choice) > 1:
2692 clist = []
2699 clist = []
2693 for aliases, table_e in choice:
2700 for aliases, table_e in choice:
General Comments 0
You need to be logged in to leave comments. Login now