mirror of
https://github.com/evennia/evennia.git
synced 2026-03-25 09:16:32 +01:00
Modifies cmdparser to not apply case-sensitive match filtering if it eliminate all results.
This commit is contained in:
parent
4944a589cc
commit
359ffdd28f
1 changed files with 5 additions and 2 deletions
|
|
@ -73,8 +73,11 @@ def cmdparser(raw_string, cmdset, caller, match_index=None):
|
|||
matches = [match for match in matches if match[2].access(caller, 'cmd')]
|
||||
|
||||
if len(matches) > 1:
|
||||
# see if it helps to analyze the match with preserved case.
|
||||
matches = [match for match in matches if raw_string.startswith(match[0])]
|
||||
# See if it helps to analyze the match with preserved case but only if
|
||||
# it leaves at least one match.
|
||||
trimmed = [match for match in matches if raw_string.startswith(match[0])]
|
||||
if trimmed:
|
||||
matches = trimmed
|
||||
|
||||
if len(matches) > 1:
|
||||
# we still have multiple matches. Sort them by count quality.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue