Add (and use) completion.use_best_match config
This commit is contained in:
parent
9d0dfd5726
commit
71048a1b55
@ -218,7 +218,9 @@ class CommandParser:
|
|||||||
for valid_command in cmdutils.cmd_dict:
|
for valid_command in cmdutils.cmd_dict:
|
||||||
if valid_command.find(cmdstr) == 0:
|
if valid_command.find(cmdstr) == 0:
|
||||||
matches.append(valid_command)
|
matches.append(valid_command)
|
||||||
if len(matches) >= 1:
|
if len(matches) == 1:
|
||||||
|
cmdstr = matches[0]
|
||||||
|
elif len(matches) > 1 and config.val.completion.use_best_match:
|
||||||
cmdstr = matches[0]
|
cmdstr = matches[0]
|
||||||
return cmdstr
|
return cmdstr
|
||||||
|
|
||||||
|
@ -656,6 +656,11 @@ completion.web_history_max_items:
|
|||||||
|
|
||||||
0: no history / -1: unlimited
|
0: no history / -1: unlimited
|
||||||
|
|
||||||
|
completion.use_best_match:
|
||||||
|
type: Bool
|
||||||
|
default: true
|
||||||
|
desc: Whether to execute the best-matching command on a partial match.
|
||||||
|
|
||||||
## downloads
|
## downloads
|
||||||
|
|
||||||
downloads.location.directory:
|
downloads.location.directory:
|
||||||
|
Loading…
Reference in New Issue
Block a user